id stringlengths 24 24 | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 314 | url stringlengths 91 255 | split stringclasses 3
values | language stringclasses 1
value | docstring stringlengths 1 14k | code stringlengths 84 381k | text stringlengths 102 381k | token_count int32 31 99.6k | doc_chars int32 1 14k | code_chars int32 84 381k | license_basis stringclasses 1
value | source stringclasses 1
value | added stringdate 2026-12-05 00:00:00 2026-12-05 00:00:00 | record_sha256 stringlengths 64 64 | license stringclasses 9
values | license_class stringclasses 1
value | license_source stringlengths 45 102 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a19a9afb0a2a83ee40fccac5 | loopsframework/base | src/Loops/Misc/EventTrait.php | EventTrait.fireEvent | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Misc/EventTrait.php#L141-L205 | train | php | Fires an event
All listeners will be executed and their return values are collected.
Simple aggregate processing can be done on the return values if needed.
By default, if no callback **specifically** returns FALSE and the aggregate is requested, the return value will evaluate to TRUE.
@param string $name The name of... | public function fireEvent($name, array $arguments = [], $boolean_aggregate = FALSE, $null_is_true = TRUE, $empty_is_true = TRUE) {
$this->registerAnnotatedEvents($name);
$events = [];
foreach($this->annotated_events[$name] as $event) {
list($is_method, $object, $key) = $event;
... | Fires an event
All listeners will be executed and their return values are collected.
Simple aggregate processing can be done on the return values if needed.
By default, if no callback **specifically** returns FALSE and the aggregate is requested, the return value will evaluate to TRUE.
@param string $name The name of... | 554 | 854 | 1,825 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 46c22c048eca55a76f6177ee533c148f2b1c851bb2f5fb0d39cc01ec339d5537 | MIT | permissive | https://github.com/loopsframework/base/blob/master/LICENSE |
9cb567a170b55be6a741332b | inceddy/everest-http | src/Everest/Http/Collections/HeaderCollection.php | HeaderCollection.normalizeHeaderName | https://github.com/inceddy/everest-http/blob/b0f6cbb6723aa96213d28c35b52e03833113be0e/src/Everest/Http/Collections/HeaderCollection.php#L58-L68 | train | php | @see RFC 822 Chapter 3.2 - 1*<any CHAR, excluding CTLs, SPACE, and ":">
@throws InvalidArgumentException
If given name is not a valid header name
@param string $name
The header name to normalize
@return string
The normalized header name | private static function normalizeHeaderName(string $name) : string
{
if (0 === preg_match('/^[^\x00-\x1F :]+$/', $name)) {
throw new InvalidArgumentException(sprintf(
'%s is not a valid header name.',
$name
));
}
return strtolower($name);
} | @see RFC 822 Chapter 3.2 - 1*<any CHAR, excluding CTLs, SPACE, and ":">
@throws InvalidArgumentException
If given name is not a valid header name
@param string $name
The header name to normalize
@return string
The normalized header name
private static function normalizeHeaderName(string $name) : string
{
if ... | 132 | 240 | 286 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 6ba4c7016f0dcdbfe6f747eac54799cabd747b63fd730747b0f5c3b7deacb8c3 | MIT | permissive | https://github.com/inceddy/everest-http/blob/master/LICENSE |
4bd70678631c482f944a9a86 | inceddy/everest-http | src/Everest/Http/Collections/HeaderCollection.php | HeaderCollection.has | https://github.com/inceddy/everest-http/blob/b0f6cbb6723aa96213d28c35b52e03833113be0e/src/Everest/Http/Collections/HeaderCollection.php#L90-L93 | train | php | {@inheritDoc} | public function has(string $name) : bool
{
return isset($this->headers[self::normalizeHeaderName($name)]);
} | {@inheritDoc}
public function has(string $name) : bool
{
return isset($this->headers[self::normalizeHeaderName($name)]);
} | 32 | 13 | 112 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | e2d5cc27212a211be0ccfd8a416ac957fe0108f33cbd8cac30332c9d0cd9acc6 | MIT | permissive | https://github.com/inceddy/everest-http/blob/master/LICENSE |
e9478deacb918b447a42b4c0 | inceddy/everest-http | src/Everest/Http/Collections/HeaderCollection.php | HeaderCollection.set | https://github.com/inceddy/everest-http/blob/b0f6cbb6723aa96213d28c35b52e03833113be0e/src/Everest/Http/Collections/HeaderCollection.php#L110-L113 | train | php | {@inheritDoc} | public function set(string $name, $value, array $options = [])
{
$this->headers[self::normalizeHeaderName($name)] = [$name, self::parseHeaderValue($value)];
} | {@inheritDoc}
public function set(string $name, $value, array $options = [])
{
$this->headers[self::normalizeHeaderName($name)] = [$name, self::parseHeaderValue($value)];
} | 46 | 13 | 162 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 026bd3ed016f05236b339355780da7ae22afacd5ee50a51c631ded63b304aa8c | MIT | permissive | https://github.com/inceddy/everest-http/blob/master/LICENSE |
0247b3663fede4d45726e662 | inceddy/everest-http | src/Everest/Http/Collections/HeaderCollection.php | HeaderCollection.with | https://github.com/inceddy/everest-http/blob/b0f6cbb6723aa96213d28c35b52e03833113be0e/src/Everest/Http/Collections/HeaderCollection.php#L120-L133 | train | php | {@inheritDoc} | public function with(string $name, $value, array $options = [])
{
$normalized = self::normalizeHeaderName($name);
$parsed = self::parseHeaderValue($value);
if ($this->get($name) === $parsed) {
return $this;
}
$new = clone $this;
$new->set($name, $value);
return $new;
} | {@inheritDoc}
public function with(string $name, $value, array $options = [])
{
$normalized = self::normalizeHeaderName($name);
$parsed = self::parseHeaderValue($value);
if ($this->get($name) === $parsed) {
return $this;
}
$new = clone $this;
$new->set($name, $value);
return $new;
} | 94 | 13 | 295 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 99b92d06dd1d57fdd8891b515985c5b9441a2fc7f217116cc3018bc70dfe3341 | MIT | permissive | https://github.com/inceddy/everest-http/blob/master/LICENSE |
9daf57a584fd769c3a82cc65 | inceddy/everest-http | src/Everest/Http/Collections/HeaderCollection.php | HeaderCollection.push | https://github.com/inceddy/everest-http/blob/b0f6cbb6723aa96213d28c35b52e03833113be0e/src/Everest/Http/Collections/HeaderCollection.php#L140-L156 | train | php | {@inheritDoc} | public function push(string $name, $value)
{
$parsed = self::parseHeaderValue($value);
if (empty($parsed)) {
return $this;
}
$normalized = self::normalizeHeaderName($name);
$this->headers[$normalized][1] = array_merge(
$this->headers[$normalized][1] ?? [],
$parsed
);
return $this;
} | {@inheritDoc}
public function push(string $name, $value)
{
$parsed = self::parseHeaderValue($value);
if (empty($parsed)) {
return $this;
}
$normalized = self::normalizeHeaderName($name);
$this->headers[$normalized][1] = array_merge(
$this->headers[$normalized][1] ?? [],
$parsed
);
return $... | 98 | 13 | 313 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 7e2ea0efd585fb80e7c0304375e6fd7416231703a1894b1e788c5e95eddb6f2b | MIT | permissive | https://github.com/inceddy/everest-http/blob/master/LICENSE |
ce7da7f4ff42d74b3c32561f | inceddy/everest-http | src/Everest/Http/Collections/HeaderCollection.php | HeaderCollection.withAdded | https://github.com/inceddy/everest-http/blob/b0f6cbb6723aa96213d28c35b52e03833113be0e/src/Everest/Http/Collections/HeaderCollection.php#L163-L184 | train | php | {@inheritDoc} | public function withAdded(string $name, $value)
{
$parsed = self::parseHeaderValue($value);
if (empty($parsed)) {
return $this;
}
$normalized = self::normalizeHeaderName($name);
$new = clone $this;
if (!isset($new->headers[$normalized])) {
$new->headers[$normalized] = [$name, []];
}
$new->hea... | {@inheritDoc}
public function withAdded(string $name, $value)
{
$parsed = self::parseHeaderValue($value);
if (empty($parsed)) {
return $this;
}
$normalized = self::normalizeHeaderName($name);
$new = clone $this;
if (!isset($new->headers[$normalized])) {
$new->headers[$normalized] = [$name, []];
... | 133 | 13 | 424 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 12642edebd94fea3cb8077d4ceff35387cca5bed11385139ef7d5b5f725d75ce | MIT | permissive | https://github.com/inceddy/everest-http/blob/master/LICENSE |
7420a4b8c488986438b4b4a6 | inceddy/everest-http | src/Everest/Http/Collections/HeaderCollection.php | HeaderCollection.without | https://github.com/inceddy/everest-http/blob/b0f6cbb6723aa96213d28c35b52e03833113be0e/src/Everest/Http/Collections/HeaderCollection.php#L201-L211 | train | php | {@inheritDoc} | public function without(string $name)
{
if (!$this->has($name)) {
return $this;
}
$new = clone $this;
unset($new->headers[self::normalizeHeaderName($name)]);
return $new;
} | {@inheritDoc}
public function without(string $name)
{
if (!$this->has($name)) {
return $this;
}
$new = clone $this;
unset($new->headers[self::normalizeHeaderName($name)]);
return $new;
} | 60 | 13 | 189 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | ff4cdfcf92ee4270015377de70f54a75e1454c75764c32e69a51944726e8b88a | MIT | permissive | https://github.com/inceddy/everest-http/blob/master/LICENSE |
110f32dc7fd8e76f55b5fee3 | inceddy/everest-http | src/Everest/Http/Collections/HeaderCollection.php | HeaderCollection.toArray | https://github.com/inceddy/everest-http/blob/b0f6cbb6723aa96213d28c35b52e03833113be0e/src/Everest/Http/Collections/HeaderCollection.php#L236-L245 | train | php | {@inheritDoc} | public function toArray() : array
{
$headers = [];
foreach ($this->headers as $header) {
$headers[$header[0]] = $header[1];
}
return $headers;
} | {@inheritDoc}
public function toArray() : array
{
$headers = [];
foreach ($this->headers as $header) {
$headers[$header[0]] = $header[1];
}
return $headers;
} | 52 | 13 | 160 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | d7203131c9d945c01c05bac426c14ea9b1245db6148418d9da1b3c0123d5ba20 | MIT | permissive | https://github.com/inceddy/everest-http/blob/master/LICENSE |
d6808d8c88df57e2a33cfe5a | sellerlabs/nucleus | src/SellerLabs/Nucleus/Support/Html.php | Html.escape | https://github.com/sellerlabs/nucleus/blob/c05d9c23d424a6bd5ab2e29140805cc6e37e4623/src/SellerLabs/Nucleus/Support/Html.php#L42-L73 | train | php | Escape the provided string.
@param SafeHtmlWrapper|SafeHtmlProducerInterface|string $string
@throws CoreException
@throws InvalidArgumentException
@return SafeHtmlWrapper|string | public static function escape($string)
{
Arguments::define(
Boa::either(
Boa::either(
Boa::instance(SafeHtmlWrapper::class),
Boa::instance(SafeHtmlProducerInterface::class)
),
Boa::string()
)
... | Escape the provided string.
@param SafeHtmlWrapper|SafeHtmlProducerInterface|string $string
@throws CoreException
@throws InvalidArgumentException
@return SafeHtmlWrapper|string
public static function escape($string)
{
Arguments::define(
Boa::either(
Boa::either(
... | 244 | 179 | 1,090 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | aab6daa867921aeb53f9b68694a1c29bab74463f0cf821db7421999e8d043e00 | MIT | permissive | https://github.com/sellerlabs/nucleus/blob/master/LICENSE |
2276ab430609aefe0c46235e | wasabi-cms/cms | src/Model/Table/MenusTable.php | MenusTable.getLinkTypes | https://github.com/wasabi-cms/cms/blob/2787b6422ea1d719cf49951b3253fd0ac31d22ca/src/Model/Table/MenusTable.php#L75-L89 | train | php | Get available link types via an Event trigger
This fetches avilable Links from all activated Plugins.
@return array | public function getLinkTypes()
{
$event = new Event('Wasabi.Backend.MenuItems.getLinkTypes', $this);
EventManager::instance()->dispatch($event);
$typeExternal = ['type' => 'external'];
$typeCustom = ['type' => 'custom'];
$event->result[__d('wasabi_core', 'General')] = [
... | Get available link types via an Event trigger
This fetches avilable Links from all activated Plugins.
@return array
public function getLinkTypes()
{
$event = new Event('Wasabi.Backend.MenuItems.getLinkTypes', $this);
EventManager::instance()->dispatch($event);
$typeExternal = ['type' => '... | 153 | 116 | 531 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 80f739f5028b4356c116e2ddb419f8d8c704d9f7373337cd69666a382458b487 | MIT | permissive | https://github.com/wasabi-cms/cms/blob/master/LICENSE.txt |
bf123e5ea5a03a85ebbeee21 | jaredtking/jaqb | src/Statement/LimitStatement.php | LimitStatement.getLimit | https://github.com/jaredtking/jaqb/blob/04a853b530fcc12a9863349d3d0da6377d1b9995/src/Statement/LimitStatement.php#L72-L79 | train | php | Gets the limit.
@return int | public function getLimit()
{
if ($this->max > 0) {
return min($this->max, $this->limit);
}
return $this->limit;
} | Gets the limit.
@return int
public function getLimit()
{
if ($this->max > 0) {
return min($this->max, $this->limit);
}
return $this->limit;
} | 49 | 28 | 158 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 8b352d509271710e05c9200c8702f22198ff252a2efdca63c55bb36cf3ed2e76 | MIT | permissive | https://github.com/jaredk2g/jaqb/blob/master/LICENSE |
e35f645c664360c97df048e5 | mauretto78/simple-event-store-manager | src/Infrastructure/Services/ElasticService.php | ElasticService.buildEventBody | https://github.com/mauretto78/simple-event-store-manager/blob/4200caa0505b90fb13852573085c4215d8ebe074/src/Infrastructure/Services/ElasticService.php#L95-L102 | train | php | @param EventInterface $event
@return array | private function buildEventBody(EventInterface $event)
{
$body = (array) $event->body();
$body['class'] = (new \ReflectionClass($event))->getShortName();
$body['occurred_on'] = $event->occurredOn()->format('Y-m-d H:i:s.u');
return $body;
} | @param EventInterface $event
@return array
private function buildEventBody(EventInterface $event)
{
$body = (array) $event->body();
$body['class'] = (new \ReflectionClass($event))->getShortName();
$body['occurred_on'] = $event->occurredOn()->format('Y-m-d H:i:s.u');
return $body;
... | 85 | 43 | 280 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 2ef9f2029b49581ccb78e793e2ed7a0d3a1b253648e95dbea569996e14820646 | MIT | permissive | https://github.com/mauretto78/simple-event-store-manager/blob/master/LICENSE.md |
405b29ec9e68743321a5bd0d | delznet/phalcon-plus | Delz/PhalconPlus/Util/Dir.php | Dir.make | https://github.com/delznet/phalcon-plus/blob/d7c118929bdaeeb63ce404ba72095397a39f82fe/Delz/PhalconPlus/Util/Dir.php#L22-L32 | train | php | 新建目录
@param string $dir
@param int $mode
@return bool
@throws \InvalidArgumentException | public static function make(string $dir, int $mode = 0755):bool
{
//如果存在相同的文件名,则抛出异常
if (is_file($dir)) {
throw new \InvalidArgumentException("Invalid directory name. Some file name is same as it.");
}
if (is_dir($dir)) {
return true;
}
return ... | 新建目录
@param string $dir
@param int $mode
@return bool
@throws \InvalidArgumentException
public static function make(string $dir, int $mode = 0755):bool
{
//如果存在相同的文件名,则抛出异常
if (is_file($dir)) {
throw new \InvalidArgumentException("Invalid directory name. Some file name is same as it.")... | 115 | 88 | 351 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 7d83aa4dbb4c18ee64caeb61908e834e80774d662cd13d57eb0afe5e18419422 | MIT | permissive | https://github.com/delznet/phalcon-plus/blob/master/LICENSE |
8d4cfb8e9df8045d5060ad1a | delznet/phalcon-plus | Delz/PhalconPlus/Util/Dir.php | Dir.read | https://github.com/delznet/phalcon-plus/blob/d7c118929bdaeeb63ce404ba72095397a39f82fe/Delz/PhalconPlus/Util/Dir.php#L43-L61 | train | php | 查找目录下的文件(支持递归)
@param string $dir 要查找的目录
@param null|string $includeRegEx 要查找的文件名匹配的正则
@param null|string $excludeRegEx 要排除的文件名匹配的正则
@return array
@throws \InvalidArgumentException | public static function read(string $dir, string $includeRegEx = null, string $excludeRegEx = null):array
{
$files = [];
if (!is_dir($dir)) {
throw new \InvalidArgumentException(
sprintf('directory "%s" is not exist.', $dir)
);
}
$iterators = ne... | 查找目录下的文件(支持递归)
@param string $dir 要查找的目录
@param null|string $includeRegEx 要查找的文件名匹配的正则
@param null|string $excludeRegEx 要排除的文件名匹配的正则
@return array
@throws \InvalidArgumentException
public static function read(string $dir, string $includeRegEx = null, string $excludeRegEx = null):array
{
$files = [];
... | 260 | 181 | 806 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 05c7de7975b28a3899ecf6ca3ab6105a45cbfa6d410b08d337a1bd1c5176f144 | MIT | permissive | https://github.com/delznet/phalcon-plus/blob/master/LICENSE |
0f6a038d4cd1f6ee77162ba4 | delznet/phalcon-plus | Delz/PhalconPlus/Util/Dir.php | Dir.delete | https://github.com/delznet/phalcon-plus/blob/d7c118929bdaeeb63ce404ba72095397a39f82fe/Delz/PhalconPlus/Util/Dir.php#L70-L91 | train | php | 删除目录
@param string $dir
@param bool $isIncludeSelf 是否删除本身
@return bool | public static function delete(string $dir, bool $isIncludeSelf = false):bool
{
if (!is_dir($dir)) {
return false;
}
$handle = opendir($dir);
while ($file = readdir($handle)) {
if ($file != '.' && $file != '..') {
$realPath = realpath($dir . '/'... | 删除目录
@param string $dir
@param bool $isIncludeSelf 是否删除本身
@return bool
public static function delete(string $dir, bool $isIncludeSelf = false):bool
{
if (!is_dir($dir)) {
return false;
}
$handle = opendir($dir);
while ($file = readdir($handle)) {
if ($file !... | 168 | 71 | 656 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 24323734c9acd02818bcd759f404501c6957f9db26c271cf7935f60170518559 | MIT | permissive | https://github.com/delznet/phalcon-plus/blob/master/LICENSE |
ceba427ca430a883f71bd951 | delznet/phalcon-plus | Delz/PhalconPlus/Util/Dir.php | Dir.normalize | https://github.com/delznet/phalcon-plus/blob/d7c118929bdaeeb63ce404ba72095397a39f82fe/Delz/PhalconPlus/Util/Dir.php#L103-L125 | train | php | 标准化目录
举例:
c:\\dir1\dir2\dir3//../dir4/./dir5 转化为c:/dir1/dir2/dir4/dir5
/usr/local/dir1/dir2/../dir3\dir4/ 转化为/usr/local/dir1/dir3/dir4
@param string $path
@return string | public static function normalize(string $path):string
{
$path = str_replace('\\', '/', $path);
$prefix = static::prefix($path);
$path = substr($path, strlen($prefix));
$parts = array_filter(explode('/', $path), 'strlen');
$tokens = array();
foreach ($parts as $part) {... | 标准化目录
举例:
c:\\dir1\dir2\dir3//../dir4/./dir5 转化为c:/dir1/dir2/dir4/dir5
/usr/local/dir1/dir2/../dir3\dir4/ 转化为/usr/local/dir1/dir3/dir4
@param string $path
@return string
public static function normalize(string $path):string
{
$path = str_replace('\\', '/', $path);
$prefix = static::prefix($path);... | 221 | 171 | 713 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 930f98431cba92f045c56569841d51cc4a4e46e727b73491d9e9286259654b4b | MIT | permissive | https://github.com/delznet/phalcon-plus/blob/master/LICENSE |
eeb53cde197d8e6095eef1b9 | delznet/phalcon-plus | Delz/PhalconPlus/Util/Dir.php | Dir.prefix | https://github.com/delznet/phalcon-plus/blob/d7c118929bdaeeb63ce404ba72095397a39f82fe/Delz/PhalconPlus/Util/Dir.php#L140-L147 | train | php | 获取路径前缀
举例:
c://dir1/dir2/dir3 返回 c://
ftp://dir1/dir2/dir3 返回 ftp://
/usr/local/src 返回 /
./dir1/dir2 返回 空
../dir1/dir2 返回 空
@param string $path
@return string | public static function prefix(string $path):string
{
preg_match('|^(?P<prefix>([a-zA-Z]+:)?//?)|', $path, $matches);
if (empty($matches['prefix'])) {
return '';
}
return strtolower($matches['prefix']);
} | 获取路径前缀
举例:
c://dir1/dir2/dir3 返回 c://
ftp://dir1/dir2/dir3 返回 ftp://
/usr/local/src 返回 /
./dir1/dir2 返回 空
../dir1/dir2 返回 空
@param string $path
@return string
public static function prefix(string $path):string
{
preg_match('|^(?P<prefix>([a-zA-Z]+:)?//?)|', $path, $matches);
if (empty($matches['... | 132 | 161 | 255 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | f1d765f7712b6d594d644a2bc8e44b2a43063bbabfe21379b8d9aa66575cf92e | MIT | permissive | https://github.com/delznet/phalcon-plus/blob/master/LICENSE |
9c7686b44335d8bf4c0c8622 | phpservicebus/core | src/EndpointConfigurator.php | EndpointConfigurator.usePersistence | https://github.com/phpservicebus/core/blob/adbcf94be1e022120ede0c5aafa8a4f7900b0a6c/src/EndpointConfigurator.php#L152-L161 | train | php | @param PersistenceDefinition $definition
@param StorageType|null $storageType
@return Persistence\PersistenceConfigurator | public function usePersistence(PersistenceDefinition $definition, StorageType $storageType = null)
{
$enabledPersistences = $this->settings->tryGet(KnownSettingsEnum::ENABLED_PERSISTENCES) ?: [];
$enabledPersistences[] = new EnabledPersistence($definition, $storageType);
$this->settings->s... | @param PersistenceDefinition $definition
@param StorageType|null $storageType
@return Persistence\PersistenceConfigurator
public function usePersistence(PersistenceDefinition $definition, StorageType $storageType = null)
{
$enabledPersistences = $this->settings->tryGet(KnownSettingsEnum::ENABLED_PERS... | 122 | 127 | 458 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | f862fafe99db343932c3e93853e9b8c7e948cac2dd917d730746b5323822d773 | MIT | permissive | https://github.com/phpservicebus/core/blob/devel/LICENSE.md |
d44ec7b64bdab7a6023ab28e | phpservicebus/core | src/EndpointConfigurator.php | EndpointConfigurator.useTransport | https://github.com/phpservicebus/core/blob/adbcf94be1e022120ede0c5aafa8a4f7900b0a6c/src/EndpointConfigurator.php#L173-L180 | train | php | @param TransportDefinition $definition
@return Transport\Config\TransportConfigurator | public function useTransport(TransportDefinition $definition)
{
$this->settings->set(TransportDefinition::class, $definition);
$this->settings->set(InboundTransport::class, new InboundTransport());
$this->settings->set(OutboundTransport::class, new OutboundTransport());
return $defi... | @param TransportDefinition $definition
@return Transport\Config\TransportConfigurator
public function useTransport(TransportDefinition $definition)
{
$this->settings->set(TransportDefinition::class, $definition);
$this->settings->set(InboundTransport::class, new InboundTransport());
$this-... | 94 | 86 | 370 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | a62e0114bd16e6448111bc489afd5537e496c4db21fe7a61e9d84119690499d3 | MIT | permissive | https://github.com/phpservicebus/core/blob/devel/LICENSE.md |
ea4825c8c52cd51a8d9896bb | phpservicebus/core | src/EndpointConfigurator.php | EndpointConfigurator.useSerialization | https://github.com/phpservicebus/core/blob/adbcf94be1e022120ede0c5aafa8a4f7900b0a6c/src/EndpointConfigurator.php#L187-L192 | train | php | @param SerializationDefinition $definition
@return SerializationConfigurator | public function useSerialization(SerializationDefinition $definition)
{
$this->settings->set(SerializationDefinition::class, $definition);
return $definition->createConfigurator($this->settings);
} | @param SerializationDefinition $definition
@return SerializationConfigurator
public function useSerialization(SerializationDefinition $definition)
{
$this->settings->set(SerializationDefinition::class, $definition);
return $definition->createConfigurator($this->settings);
} | 54 | 77 | 222 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 227314922c5cb841af7c2d1e0ec28772c33f1ce17cf1a87d532364750084bca2 | MIT | permissive | https://github.com/phpservicebus/core/blob/devel/LICENSE.md |
e7897f6ea9a2aa7f50ea73c0 | phpservicebus/core | src/EndpointConfigurator.php | EndpointConfigurator.useUuidGeneration | https://github.com/phpservicebus/core/blob/adbcf94be1e022120ede0c5aafa8a4f7900b0a6c/src/EndpointConfigurator.php#L199-L204 | train | php | @param UuidGenerationDefinition $definition
@return UuidGenerationConfigurator | public function useUuidGeneration(UuidGenerationDefinition $definition)
{
$this->settings->set(UuidGenerationDefinition::class, $definition);
return $definition->createConfigurator($this->settings);
} | @param UuidGenerationDefinition $definition
@return UuidGenerationConfigurator
public function useUuidGeneration(UuidGenerationDefinition $definition)
{
$this->settings->set(UuidGenerationDefinition::class, $definition);
return $definition->createConfigurator($this->settings);
} | 61 | 79 | 225 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 7cd6bbffb7041c5ef2884a2b8516e602a29765adedb80b1564b5fd1d28b183c1 | MIT | permissive | https://github.com/phpservicebus/core/blob/devel/LICENSE.md |
b4adf3964a8ab8797c2ffefa | phpservicebus/core | src/EndpointConfigurator.php | EndpointConfigurator.registerPipelineStep | https://github.com/phpservicebus/core/blob/adbcf94be1e022120ede0c5aafa8a4f7900b0a6c/src/EndpointConfigurator.php#L306-L309 | train | php | @param string $stepId
@param string $stepFqcn
@param callable|null $factory
@param string|null $description
@return Pipeline\StepRegistration | public function registerPipelineStep($stepId, $stepFqcn, callable $factory = null, $description = null)
{
return $this->pipelineModifications->registerStep($stepId, $stepFqcn, $factory, $description);
} | @param string $stepId
@param string $stepFqcn
@param callable|null $factory
@param string|null $description
@return Pipeline\StepRegistration
public function registerPipelineStep($stepId, $stepFqcn, callable $factory = null, $description = null)
{
return $this->pipelineModifications->regis... | 92 | 158 | 218 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 8b646b4c32a4df6c1eac06f78d2ff3a6357823e21acf263ad5007ad0085a75c0 | MIT | permissive | https://github.com/phpservicebus/core/blob/devel/LICENSE.md |
91af9b3e81fdd085a8b7f2b3 | 10usb/css-lib | src/query/Specificity.php | Specificity.compare | https://github.com/10usb/css-lib/blob/6370b1404bae3eecb44c214ed4eaaf33113858dd/src/query/Specificity.php#L40-L46 | train | php | Compares to specificities
@param \csslib\query\Specificity $left
@param \csslib\query\Specificity $right
@return integer | public static function compare($left, $right){
if($left->a != $right->a) return $left->a <=> $right->a;
if($left->b != $right->b) return $left->b <=> $right->b;
if($left->c != $right->c) return $left->c <=> $right->c;
if($left->i < 0 || $right->i < 0) return 0;
return $left->i <=> $right->i;
} | Compares to specificities
@param \csslib\query\Specificity $left
@param \csslib\query\Specificity $right
@return integer
public static function compare($left, $right){
if($left->a != $right->a) return $left->a <=> $right->a;
if($left->b != $right->b) return $left->b <=> $right->b;
if($left->c != $right->c) retur... | 148 | 120 | 305 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | d126b02e6196a10dd1cc449aa302351276e08fdf2196194eabe0641f0a64dec0 | MIT | permissive | https://github.com/10usb/css-lib/blob/master/LICENSE |
20e07fe058006bc09ea03dc3 | 10usb/css-lib | src/query/Specificity.php | Specificity.get | https://github.com/10usb/css-lib/blob/6370b1404bae3eecb44c214ed4eaaf33113858dd/src/query/Specificity.php#L53-L63 | train | php | Calculated the specificity of a selector
@param \csslib\Selector $selector
@return \csslib\query\Specificity | public static function get($selector){
$specificity = $selector->hasNext() ? self::get($selector->getNext()) : new self();
if($selector->getIdentification()) $specificity->a++;
if($selector->getClasses()) $specificity->b+= count($selector->getClasses());
if($selector->getAttributes()) $specificity->b+= count... | Calculated the specificity of a selector
@param \csslib\Selector $selector
@return \csslib\query\Specificity
public static function get($selector){
$specificity = $selector->hasNext() ? self::get($selector->getNext()) : new self();
if($selector->getIdentification()) $specificity->a++;
if($selector->getClasses... | 165 | 108 | 507 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 774bbc7618a2d727fbec9b4987dcc8801be0e7be54e697f8e76ae830b63cd181 | MIT | permissive | https://github.com/10usb/css-lib/blob/master/LICENSE |
06c2359b3bab62948a401953 | jivoo/http | src/Message/Response.php | Response.withStatus | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Message/Response.php#L60-L69 | train | php | {@inheritdoc} | public function withStatus($code, $reasonPhrase = '')
{
$response = clone $this;
$response->status = $code;
if ($reasonPhrase == '') {
$reasonPhrase = Status::phrase($code);
}
$response->reason = $reasonPhrase;
return $response;
} | {@inheritdoc}
public function withStatus($code, $reasonPhrase = '')
{
$response = clone $this;
$response->status = $code;
if ($reasonPhrase == '') {
$reasonPhrase = Status::phrase($code);
}
$response->reason = $reasonPhrase;
return $response;
} | 72 | 13 | 298 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 8859f5ef9008393f60d8da040f7c92454d6777070d4eb5ec719a6eb7f75a831f | MIT | permissive | https://github.com/nielssp/jivoo-http/blob/master/LICENSE |
ded5e7467037cfbee23e8e7b | jivoo/http | src/Message/Response.php | Response.cached | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Message/Response.php#L77-L90 | train | php | Set cache settings.
@param string $public Public or private.
@param int|string $expires Time on which cache expires. Can be a UNIX
timestamp or a string used with {@see strtotime()}. | public function cached($public = true, $expires = '+1 year')
{
if (!is_int($expires)) {
$expires = strtotime($expires);
}
$maxAge = $expires - time();
$pragma = $public ? 'public' : 'private';
$cache = $pragma . ', max-age=' . $maxAge;
$response = clone $t... | Set cache settings.
@param string $public Public or private.
@param int|string $expires Time on which cache expires. Can be a UNIX
timestamp or a string used with {@see strtotime()}.
public function cached($public = true, $expires = '+1 year')
{
if (!is_int($expires)) {
$expires = strtotime($ex... | 170 | 182 | 526 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | d996d4c441da503b10ea20e1da9e1bdd80e852ce9b5ce84235fe1a7174b4a8e0 | MIT | permissive | https://github.com/nielssp/jivoo-http/blob/master/LICENSE |
455d122c10155126a1129afe | jivoo/http | src/Message/Response.php | Response.redirect | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Message/Response.php#L99-L107 | train | php | Create a redirect response.
@param string $location Redirect target.
@param bool $permanent Whether redirect is permanent.
@return self The response. | public static function redirect($location, $permanent = false)
{
$response = new self(
$permanent ? Status::MOVED_PERMANENTLY : Status::SEE_OTHER,
new StringStream('')
);
$response->setHeader('Location', $location);
return $response;
} | Create a redirect response.
@param string $location Redirect target.
@param bool $permanent Whether redirect is permanent.
@return self The response.
public static function redirect($location, $permanent = false)
{
$response = new self(
$permanent ? Status::MOVED_PERMANENTLY : Status::SEE_OTHE... | 90 | 150 | 299 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 2202d700d7a930c628255ab8ee642a18a4298ce86dd1de05d9990197e39df88d | MIT | permissive | https://github.com/nielssp/jivoo-http/blob/master/LICENSE |
133802a71e13413d46d65ff4 | jivoo/http | src/Message/Response.php | Response.file | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Message/Response.php#L116-L126 | train | php | Create a file response.
@param string $path Path to file.
@param string|null $type Optional MIME type.
@return self The response. | public static function file($path, $type = null)
{
$response = new self(
Status::OK,
new PhpStream($path, 'rb')
);
if (isset($type)) {
$response->setHeader('Content-Type', $type);
}
return $response;
} | Create a file response.
@param string $path Path to file.
@param string|null $type Optional MIME type.
@return self The response.
public static function file($path, $type = null)
{
$response = new self(
Status::OK,
new PhpStream($path, 'rb')
);
if (isset($type)) {
... | 95 | 130 | 285 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 7250a03ced241403ef33be9d6644d79d29beb1d81ddd8d5686f844b2215a8437 | MIT | permissive | https://github.com/nielssp/jivoo-http/blob/master/LICENSE |
b0fa9f35874a053c900fb86f | pletfix/core | src/Services/PDOs/PostgreSQL.php | PostgreSQL.getDsn | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/PostgreSQL.php#L93-L115 | train | php | Create a DSN string from a configuration.
@param array $config
@return string | private function getDsn(array $config)
{
$host = isset($config['host']) ? "host={$config['host']};" : '';
$dsn = "pgsql:{$host}dbname={$config['database']}";
if (isset($config['port'])) {
$dsn .= ";port={$config['port']}";
}
if (isset($config['sslmode'])) {
... | Create a DSN string from a configuration.
@param array $config
@return string
private function getDsn(array $config)
{
$host = isset($config['host']) ? "host={$config['host']};" : '';
$dsn = "pgsql:{$host}dbname={$config['database']}";
if (isset($config['port'])) {
$dsn .=... | 211 | 81 | 727 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 3a035f8094db6ecd5112d656675146420282574e833f31a3716e38e0155583b9 | MIT | permissive | https://github.com/pletfix/core/blob/master/LICENSE |
41607be88d6edea41d140ecf | nonetallt/jinitialize-core | src/JinitializeApplication.php | JinitializeApplication.registerPlugin | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/JinitializeApplication.php#L61-L82 | train | php | Register a plugin found in manifest file
@param array $plugin
@return null | public function registerPlugin(array $plugin)
{
/* Dont't process nameless plugins */
if(! isset($plugin['name'])) return;
/* Create a container for the plugin */
$this->getContainer()->addPlugin($plugin['name']);
/* Commands are registered first so they can be found be por... | Register a plugin found in manifest file
@param array $plugin
@return null
public function registerPlugin(array $plugin)
{
/* Dont't process nameless plugins */
if(! isset($plugin['name'])) return;
/* Create a container for the plugin */
$this->getContainer()->addPlugin($plugin['n... | 188 | 75 | 804 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 14e51a48bac9031b966dab3ce1ca0947789535d403caee5f5d77604efdd06749 | MIT | permissive | https://github.com/nonetallt/jinitialize-core/blob/master/LICENSE |
670e406b7358fbb1abdf3c21 | nonetallt/jinitialize-core | src/JinitializeApplication.php | JinitializeApplication.registerProcedures | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/JinitializeApplication.php#L87-L103 | train | php | Register all procedures for a given plugin | public function registerProcedures(string $plugin, array $procedures, string $path)
{
/* Append the installation path before the files */
array_walk($procedures, function(&$procedure) use ($path){
$procedure = "$path/$procedure";
});
/* Create a factory from list of path... | Register all procedures for a given plugin
public function registerProcedures(string $plugin, array $procedures, string $path)
{
/* Append the installation path before the files */
array_walk($procedures, function(&$procedure) use ($path){
$procedure = "$path/$procedure";
});
... | 154 | 42 | 700 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 59bc762a6aa5728b467c2843073f1219eeb9e1de7d22516513ef43ff186aff8e | MIT | permissive | https://github.com/nonetallt/jinitialize-core/blob/master/LICENSE |
2cd55d4bb73ea39ad0e01d07 | nonetallt/jinitialize-core | src/JinitializeApplication.php | JinitializeApplication.registerCommands | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/JinitializeApplication.php#L114-L125 | train | php | Register all commands for a given plugin
@param string $plugin The plugin these commands will be registered for
@param array $commands array containing the classnames of the commands
@return array $newCommands array containing JinitializeCommand objects | public function registerCommands(string $plugin, array $commands)
{
$newCommands = [];
foreach($commands as $commandClass) {
$command = new $commandClass($plugin);
$command = CommandFactory::setNamespace($command);
$this->add($command);
$newCommands[]... | Register all commands for a given plugin
@param string $plugin The plugin these commands will be registered for
@param array $commands array containing the classnames of the commands
@return array $newCommands array containing JinitializeCommand objects
public function registerCommands(string $plugin, array $command... | 126 | 255 | 377 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 32ca1172ee3ed461909e69c7a7b1ed916120079c1a553e925adb2240175e8d30 | MIT | permissive | https://github.com/nonetallt/jinitialize-core/blob/master/LICENSE |
8eddf7610f916187460b2531 | nonetallt/jinitialize-core | src/JinitializeApplication.php | JinitializeApplication.missingSettings | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/JinitializeApplication.php#L150-L162 | train | php | Get an array of plugins and their settings that are not defined in env | public function missingSettings()
{
$missing = [];
foreach($this->recommendedSettings() as $plugin => $settings) {
foreach($settings as $setting) {
/* Get value for the setting */
$value = $_ENV[$setting] ?? null;
if(is_null($value)) $miss... | Get an array of plugins and their settings that are not defined in env
public function missingSettings()
{
$missing = [];
foreach($this->recommendedSettings() as $plugin => $settings) {
foreach($settings as $setting) {
/* Get value for the setting */
$val... | 99 | 70 | 401 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | e77533e225809a3b52796d1dac0d71ee173c1bd0281e384301dda05cad036323 | MIT | permissive | https://github.com/nonetallt/jinitialize-core/blob/master/LICENSE |
6023a58fb46cfe09508c283e | weew/console | src/Weew/Console/Output.php | Output.write | https://github.com/weew/console/blob/083703f21fdeff3cfe6036ebd21ab9cb84ca74c7/src/Weew/Console/Output.php#L73-L87 | train | php | @param string $string
@param int $options
@return IOutput
@see OutputVerbosity
@see OutputProcessing | public function write($string, $options = null) {
if ($options === null) {
$options = OutputVerbosity::NORMAL;
}
if ($this->is($options)) {
$this->buffer->write($string);
if ( ! $this->isBufferingEnabled()) {
$this->flushBuffer();
... | @param string $string
@param int $options
@return IOutput
@see OutputVerbosity
@see OutputProcessing
public function write($string, $options = null) {
if ($options === null) {
$options = OutputVerbosity::NORMAL;
}
if ($this->is($options)) {
$this->buffer->write($strin... | 108 | 102 | 361 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 12e44da5e3f4098ac02d6adb2f7d62b498a99ddb40b26dc52023a8e67ef90755 | MIT | permissive | https://github.com/weew/console/blob/master/licence.md |
2023b9c35bc00287b8c6f1a2 | weew/console | src/Weew/Console/Output.php | Output.writeIndented | https://github.com/weew/console/blob/083703f21fdeff3cfe6036ebd21ab9cb84ca74c7/src/Weew/Console/Output.php#L109-L111 | train | php | @param string $string
@param int $spaces
@param null $options
@return IOutput | public function writeIndented($string, $spaces = 2, $options = null) {
return $this->write($this->indent($string, $spaces), $options);
} | @param string $string
@param int $spaces
@param null $options
@return IOutput
public function writeIndented($string, $spaces = 2, $options = null) {
return $this->write($this->indent($string, $spaces), $options);
} | 59 | 78 | 148 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | df1407d1d6a93c4e28af5046a5f53e9ccd9e81d3e0ecd210a356afb9bad77954 | MIT | permissive | https://github.com/weew/console/blob/master/licence.md |
5c55603539b7e3407dca01f5 | weew/console | src/Weew/Console/Output.php | Output.writeLineIndented | https://github.com/weew/console/blob/083703f21fdeff3cfe6036ebd21ab9cb84ca74c7/src/Weew/Console/Output.php#L120-L122 | train | php | @param string $string
@param int $spaces
@param null $options
@return IOutput | public function writeLineIndented($string, $spaces = 2, $options = null) {
return $this->writeLine($this->indent($string, $spaces), $options);
} | @param string $string
@param int $spaces
@param null $options
@return IOutput
public function writeLineIndented($string, $spaces = 2, $options = null) {
return $this->writeLine($this->indent($string, $spaces), $options);
} | 61 | 78 | 156 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 88073435ac46d872ae88edd2e09c55c6e231a22f3c1c8f286e118a855bcab231 | MIT | permissive | https://github.com/weew/console/blob/master/licence.md |
a431bdf7540dc8bd9c5ed0be | weew/console | src/Weew/Console/Output.php | Output.indent | https://github.com/weew/console/blob/083703f21fdeff3cfe6036ebd21ab9cb84ca74c7/src/Weew/Console/Output.php#L130-L139 | train | php | @param string $string
@param int $spaces
@return string | public function indent($string, $spaces = 2) {
$indentation = str_repeat(' ', $spaces);
$lines = explode("\n", $string);
foreach ($lines as $index => $line) {
$lines[$index] = $indentation . $line;
}
return implode("\n", $lines);
} | @param string $string
@param int $spaces
@return string
public function indent($string, $spaces = 2) {
$indentation = str_repeat(' ', $spaces);
$lines = explode("\n", $string);
foreach ($lines as $index => $line) {
$lines[$index] = $indentation . $line;
}
return i... | 88 | 56 | 289 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 94a4efcfc4ebee927e93c8b5fd6ef9fc54ba3471d709b38a602c22b108688367 | MIT | permissive | https://github.com/weew/console/blob/master/licence.md |
2c6b94bb4477563f8451d2ba | weew/console | src/Weew/Console/Output.php | Output.format | https://github.com/weew/console/blob/083703f21fdeff3cfe6036ebd21ab9cb84ca74c7/src/Weew/Console/Output.php#L148-L164 | train | php | @param string $string
@param null $format
@return string | public function format($string, $format = null) {
if ($format === null) {
$format = $this->getOutputFormat();
}
// print output with ansi support
if (($format & OutputFormat::NORMAL) === OutputFormat::NORMAL) {
return $this->formatter->formatAnsi($string);
... | @param string $string
@param null $format
@return string
public function format($string, $format = null) {
if ($format === null) {
$format = $this->getOutputFormat();
}
// print output with ansi support
if (($format & OutputFormat::NORMAL) === OutputFormat::NORMAL) {
... | 141 | 58 | 573 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | a2ffc998d5a5f30597e3be00fc26f4d47c3eda446c9c5f311ea045946bbab243 | MIT | permissive | https://github.com/weew/console/blob/master/licence.md |
664885aadd03be00950cfef8 | weew/console | src/Weew/Console/Output.php | Output.flushBuffer | https://github.com/weew/console/blob/083703f21fdeff3cfe6036ebd21ab9cb84ca74c7/src/Weew/Console/Output.php#L219-L225 | train | php | Manually flush buffered output. | public function flushBuffer() {
$content = $this->format($this->buffer->flush());
if ( ! $this->is(OutputVerbosity::SILENT)) {
fwrite($this->getOutputStream(), $content);
}
} | Manually flush buffered output.
public function flushBuffer() {
$content = $this->format($this->buffer->flush());
if ( ! $this->is(OutputVerbosity::SILENT)) {
fwrite($this->getOutputStream(), $content);
}
} | 59 | 31 | 215 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 331f4614d20c24eed37e086f98f3eca3ada3a4f3960ae18e25befdb3789760f0 | MIT | permissive | https://github.com/weew/console/blob/master/licence.md |
77fe7093395b229a5e0983e1 | weew/console | src/Weew/Console/Output.php | Output.is | https://github.com/weew/console/blob/083703f21fdeff3cfe6036ebd21ab9cb84ca74c7/src/Weew/Console/Output.php#L271-L274 | train | php | @param int $options
@return bool | protected function is($options) {
return ($this->getOutputVerbosity() & $options) === $options
|| ($this->getOutputFormat() & $options) === $options;
} | @param int $options
@return bool
protected function is($options) {
return ($this->getOutputVerbosity() & $options) === $options
|| ($this->getOutputFormat() & $options) === $options;
} | 52 | 33 | 175 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | d361b152a5df492b62fe92161d819136c2f5da1069ea9230e9581febae274656 | MIT | permissive | https://github.com/weew/console/blob/master/licence.md |
5995ff1eac39037f1a8ff25d | apitude/apitude | src/Provider/RedisServiceProvider.php | RedisServiceProvider.register | https://github.com/apitude/apitude/blob/ccf503e42214184f96cd73b4e0fc5d06c377bce5/src/Provider/RedisServiceProvider.php#L16-L26 | train | php | Registers services on the given app.
This method should only be used to configure services and parameters.
It should not get services.
@param Application $app | public function register(Application $app)
{
$app['redis'] = $app->share(function ($app) {
$config = $app['config'];
$redis = new \Redis();
if (!$redis->connect($config['redis']['host'], $config['redis']['port'])) {
throw new \RuntimeException('Unable to c... | Registers services on the given app.
This method should only be used to configure services and parameters.
It should not get services.
@param Application $app
public function register(Application $app)
{
$app['redis'] = $app->share(function ($app) {
$config = $app['config'];
$redis... | 117 | 159 | 404 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 672e480fe9655d4ab42a23e44e58d7ca7457d17e10c766ee79dab3d42a4c4624 | MIT | permissive | https://github.com/apitude/apitude/blob/master/LICENSE |
f4d0ff033c554872269c9d22 | jonneyless/yii2-helper-extend | helpers/Image.php | Image.getImg | https://github.com/jonneyless/yii2-helper-extend/blob/1c1afa051e219865f52d40c728c0a95f1ae54106/helpers/Image.php#L38-L116 | train | php | 当原图不存在时用默认图替换
@param $original
@param int $width
@param int $height
@param bool $default
@param int $mode
@return mixed
@throws \Imagine\Image\InvalidArgumentException | public static function getImg($original, $width = 0, $height = 0, $default = true, $mode = self::THUMB_MODE_CUT)
{
$assetUrl = Yii::$app->getAssetManager()->getPublishedUrl('@vendor/jonneyless/yii2-admin-asset/statics');
if(!file_exists($assetUrl)){
Yii::$app->getAssetManager()->publish... | 当原图不存在时用默认图替换
@param $original
@param int $width
@param int $height
@param bool $default
@param int $mode
@return mixed
@throws \Imagine\Image\InvalidArgumentException
public static function getImg($original, $width = 0, $height = 0, $default = true, $mode = self::THUMB_MODE_CUT)
{
$assetUrl = Yi... | 711 | 177 | 2,713 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 48bf4b71eaa0056eaed0305d596cf9f902fe057b0b6e76042939509e21ab873e | MIT | permissive | https://github.com/jonneyless/yii2-helper-extend/blob/master/LICENSE |
b5cab8eea0a3cb32141289bd | jonneyless/yii2-helper-extend | helpers/Image.php | Image.resizeImg | https://github.com/jonneyless/yii2-helper-extend/blob/1c1afa051e219865f52d40c728c0a95f1ae54106/helpers/Image.php#L128-L135 | train | php | 缩小图片
@param $image
@param $width
@param int $height
@return string
@throws \Imagine\Image\InvalidArgumentException | public static function resizeImg($image, $width, $height = 0)
{
$newImg = self::getImg($image, $width, $height, false, ManipulatorInterface::THUMBNAIL_OUTBOUND);
if(self::copyImg($newImg, $image)){
File::delFile($newImg);
}
} | 缩小图片
@param $image
@param $width
@param int $height
@return string
@throws \Imagine\Image\InvalidArgumentException
public static function resizeImg($image, $width, $height = 0)
{
$newImg = self::getImg($image, $width, $height, false, ManipulatorInterface::THUMBNAIL_OUTBOUND);
if(self::co... | 107 | 124 | 270 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 542b8748336ca3820c6c1b6d3143e6b01e151658fef4f1c6b1cc73166b221d7a | MIT | permissive | https://github.com/jonneyless/yii2-helper-extend/blob/master/LICENSE |
254246f799eda2c82c38f817 | jonneyless/yii2-helper-extend | helpers/Image.php | Image.verticalSplitImg | https://github.com/jonneyless/yii2-helper-extend/blob/1c1afa051e219865f52d40c728c0a95f1ae54106/helpers/Image.php#L146-L185 | train | php | @param $original
@param $maxHeight
@param string $subFolder
@return array
@throws \Imagine\Image\InvalidArgumentException
@throws \yii\base\ErrorException | public static function verticalSplitImg($original, $maxHeight, $subFolder = 'image')
{
$originalStatic = Folder::getStatic($original);
if(!file_exists($originalStatic) || is_dir($originalStatic)){
throw new ErrorException('Not image file!');
}
list($oWidth, $oHeight) = ... | @param $original
@param $maxHeight
@param string $subFolder
@return array
@throws \Imagine\Image\InvalidArgumentException
@throws \yii\base\ErrorException
public static function verticalSplitImg($original, $maxHeight, $subFolder = 'image')
{
$originalStatic = Folder::getStatic($original);
... | 310 | 169 | 1,106 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | b99d907f4bdabe4d6ddca9e978e9122b86413e92640befcf353dc16e79624e40 | MIT | permissive | https://github.com/jonneyless/yii2-helper-extend/blob/master/LICENSE |
ede4846cb89c2404c5b95582 | jonneyless/yii2-helper-extend | helpers/Image.php | Image.cropImg | https://github.com/jonneyless/yii2-helper-extend/blob/1c1afa051e219865f52d40c728c0a95f1ae54106/helpers/Image.php#L197-L202 | train | php | @param $image
@param $newImg
@param $width
@param $height
@param array $start
@return \Imagine\Image\ImageInterface
@throws \Imagine\Image\InvalidArgumentException | public static function cropImg($image, $newImg, $width, $height, array $start = [0, 0])
{
return YiiImage::crop($image, $width, $height, $start)
->interlace(ImageInterface::INTERLACE_LINE)
->save($newImg, ['quality' => 100]);
} | @param $image
@param $newImg
@param $width
@param $height
@param array $start
@return \Imagine\Image\ImageInterface
@throws \Imagine\Image\InvalidArgumentException
public static function cropImg($image, $newImg, $width, $height, array $start = [0, 0])
{
return YiiImage::crop($image... | 117 | 188 | 267 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 240fd4bbdf35b9ccbca815bd0fb2b438059d8c6347295dbf274a8559261b97e6 | MIT | permissive | https://github.com/jonneyless/yii2-helper-extend/blob/master/LICENSE |
02109f56384bc2a8218d4122 | jonneyless/yii2-helper-extend | helpers/Image.php | Image.copyImg | https://github.com/jonneyless/yii2-helper-extend/blob/1c1afa051e219865f52d40c728c0a95f1ae54106/helpers/Image.php#L214-L243 | train | php | 复制图片
@param string $oldImg
@param string $newImg
@param string $subFolder
@param boolean $returnStatic
@return string | public static function copyImg($oldImg, $newImg = '', $subFolder = '', $returnStatic = false)
{
if(substr($oldImg, 0, 4) != 'http'){
$oldImgStatic = Folder::getStatic($oldImg);
if(!$oldImg || !file_exists($oldImgStatic)){
return $oldImg;
}
}else{
... | 复制图片
@param string $oldImg
@param string $newImg
@param string $subFolder
@param boolean $returnStatic
@return string
public static function copyImg($oldImg, $newImg = '', $subFolder = '', $returnStatic = false)
{
if(substr($oldImg, 0, 4) != 'http'){
$oldImgStatic = Folder::getStatic($oldI... | 251 | 122 | 858 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 00c2ab5e8791a953ce1f09bad5f4c1c8b7ee3a037def06781197251fc0699001 | MIT | permissive | https://github.com/jonneyless/yii2-helper-extend/blob/master/LICENSE |
3bdae5873b92288ade72926d | jonneyless/yii2-helper-extend | helpers/Image.php | Image.recoverImg | https://github.com/jonneyless/yii2-helper-extend/blob/1c1afa051e219865f52d40c728c0a95f1ae54106/helpers/Image.php#L252-L284 | train | php | 将字符串内的图片元数据保存为图片
@param $content
@return mixed | public static function recoverImg($content)
{
preg_match_all('/src="data:\s*image\/(\w+);base64,([^"]+)"/', $content, $match);
$imgs = [];
if(isset($match[2])){
foreach($match[2] as $key => $data){
$md5 = md5($data);
if(isset($imgs[$md5])){
... | 将字符串内的图片元数据保存为图片
@param $content
@return mixed
public static function recoverImg($content)
{
preg_match_all('/src="data:\s*image\/(\w+);base64,([^"]+)"/', $content, $match);
$imgs = [];
if(isset($match[2])){
foreach($match[2] as $key => $data){
$md5 = md5($dat... | 239 | 48 | 896 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 272dba15dc4d94a5281e1d890c7d68f783752f09180a600627ac741e8dde08b4 | MIT | permissive | https://github.com/jonneyless/yii2-helper-extend/blob/master/LICENSE |
150d01f69e236146714d70b3 | harvestcloud/CoreBundle | DataFixtures/ORM/LoadExchangeData.php | LoadExchangeData.load | https://github.com/harvestcloud/CoreBundle/blob/f33e079c4a6191cf674aa2678f2fb2e6f0dd89cc/DataFixtures/ORM/LoadExchangeData.php#L49-L56 | train | php | {@inheritDoc}
@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since 2013-03-03
@param \Doctrine\Common\Persistence\ObjectManager $manager | public function load(ObjectManager $manager)
{
$exchange = new Exchange();
$exchange->setName('The Harvest Cloud');
$manager->persist($exchange);
$manager->flush();
} | {@inheritDoc}
@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since 2013-03-03
@param \Doctrine\Common\Persistence\ObjectManager $manager
public function load(ObjectManager $manager)
{
$exchange = new Exchange();
$exchange->setName('The Harvest Cloud');
$manager->persist($exchange)... | 85 | 145 | 207 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 56df9b454fdea0d3268f6138c50749894ee98b2a79acbbda19e49e2983badee5 | MIT | permissive | https://github.com/harvestcloudold/CoreBundle/blob/master/LICENSE |
267f45667dc9c61d01662133 | martinhej/robocloud | src/robocloud/Message/MessageFactory.php | MessageFactory.unserialize | https://github.com/martinhej/robocloud/blob/108dfbc2b6e9aca2a87795c3e7518cbf1cf5d229/src/robocloud/Message/MessageFactory.php#L62-L71 | train | php | {@inheritdoc} | public function unserialize($serialized_message): MessageInterface
{
$result = json_decode($serialized_message, TRUE);
if (empty($result) || is_string($result)) {
throw new \InvalidArgumentException('Could not unserialize the message data');
}
return $this->setMessageDa... | {@inheritdoc}
public function unserialize($serialized_message): MessageInterface
{
$result = json_decode($serialized_message, TRUE);
if (empty($result) || is_string($result)) {
throw new \InvalidArgumentException('Could not unserialize the message data');
}
return $thi... | 71 | 13 | 355 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 11132507315017e79e8dbe04c584a99edc35f53c8d8dabc13b249e6723bc168f | Apache-2.0 | permissive | https://github.com/martinhej/robocloud/blob/master/LICENSE |
48a2b7e305816ea9c795fe2b | martinhej/robocloud | src/robocloud/Message/MessageFactory.php | MessageFactory.createMessage | https://github.com/martinhej/robocloud/blob/108dfbc2b6e9aca2a87795c3e7518cbf1cf5d229/src/robocloud/Message/MessageFactory.php#L86-L99 | train | php | {@inheritdoc} | public function createMessage(): MessageInterface
{
if (!is_string($this->messageClass) || !in_array(MessageInterface::class, class_implements($this->messageClass))) {
throw new InvalidMessageClassException('Invalid message class provided: ' . $this->messageClass);
}
/** @var \... | {@inheritdoc}
public function createMessage(): MessageInterface
{
if (!is_string($this->messageClass) || !in_array(MessageInterface::class, class_implements($this->messageClass))) {
throw new InvalidMessageClassException('Invalid message class provided: ' . $this->messageClass);
}
... | 139 | 13 | 623 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 138fbcfe0608d108c602440c95750ced3d766e7ae1a7716d7edc0b5653103d73 | Apache-2.0 | permissive | https://github.com/martinhej/robocloud/blob/master/LICENSE |
352ccf3410fe5d20d9a47e4c | harmony-project/modular-routing | source/Metadata/Loader/XmlFileLoader.php | XmlFileLoader.load | https://github.com/harmony-project/modular-routing/blob/399bb427678ddc17c67295c738b96faea485e2d8/source/Metadata/Loader/XmlFileLoader.php#L33-L51 | train | php | Loads an XML file.
@param string $file An XML file path
@param string|null $type The resource type
@return array A collection of metadata
@throws \InvalidArgumentException When the file cannot be loaded or when the XML cannot be
parsed because it does not validate against the scheme. | public function load($file, $type = null)
{
$path = $this->locator->locate($file);
$xml = $this->loadFile($path);
$collection = [];
// process routes and imports
foreach ($xml->documentElement->childNodes as $node) {
if (!$node instanceof \DOMElement) {
... | Loads an XML file.
@param string $file An XML file path
@param string|null $type The resource type
@return array A collection of metadata
@throws \InvalidArgumentException When the file cannot be loaded or when the XML cannot be
parsed because it does not validate against the scheme.
public ... | 165 | 311 | 462 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 848f3395c651864a42805798e1e14f114ed2abb933046f00dc361854dddfe5cf | MIT | permissive | https://github.com/harmony-project/modular-routing/blob/master/license |
031fb1fedf8dbee591de8bb5 | harmony-project/modular-routing | source/Metadata/Loader/XmlFileLoader.php | XmlFileLoader.parseConfigs | https://github.com/harmony-project/modular-routing/blob/399bb427678ddc17c67295c738b96faea485e2d8/source/Metadata/Loader/XmlFileLoader.php#L86-L109 | train | php | Parses the config elements (resource).
@param \DOMElement $node Element to parse that contains the configs
@param string $path Full path of the XML file being processed
@return array An array with the resource items
@throws \InvalidArgumentException When the XML is invalid | protected function parseConfigs(\DOMElement $node, $path)
{
$resources = [];
/** @var \DOMElement $n */
foreach ($node->getElementsByTagName('*') as $n) {
if ($node !== $n->parentNode) {
continue;
}
switch ($n->localName) {
... | Parses the config elements (resource).
@param \DOMElement $node Element to parse that contains the configs
@param string $path Full path of the XML file being processed
@return array An array with the resource items
@throws \InvalidArgumentException When the XML is invalid
protected function parseConfigs(\DOME... | 217 | 281 | 799 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 26efdcc72230298e0ca4e664a7418d0229b428dff944b629b9bf645ea77a62ba | MIT | permissive | https://github.com/harmony-project/modular-routing/blob/master/license |
b29f4b6dda1f2ea00c2db229 | harmony-project/modular-routing | source/Metadata/Loader/XmlFileLoader.php | XmlFileLoader.parseNode | https://github.com/harmony-project/modular-routing/blob/399bb427678ddc17c67295c738b96faea485e2d8/source/Metadata/Loader/XmlFileLoader.php#L121-L133 | train | php | Parses a node from a loaded XML file.
@param array $collection Collection to associate with the node
@param \DOMElement $node Element to parse
@param string $path Full path of the XML file being processed
@param string $file Loaded file name
@throws \InvalidArgumentException When the... | protected function parseNode(array &$collection, \DOMElement $node, $path, $file)
{
switch ($node->localName) {
case 'module':
$this->parseMetadata($collection, $node, $path);
break;
case 'import':
$this->parseImport($collection, $node,... | Parses a node from a loaded XML file.
@param array $collection Collection to associate with the node
@param \DOMElement $node Element to parse
@param string $path Full path of the XML file being processed
@param string $file Loaded file name
@throws \InvalidArgumentException When the... | 192 | 335 | 552 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | caf4fd9463d06af625d98f00acdbbb81b763584c189274575e75940d87e24c59 | MIT | permissive | https://github.com/harmony-project/modular-routing/blob/master/license |
f423146544a5bbf23102ad40 | harmony-project/modular-routing | source/Metadata/Loader/XmlFileLoader.php | XmlFileLoader.parseMetadata | https://github.com/harmony-project/modular-routing/blob/399bb427678ddc17c67295c738b96faea485e2d8/source/Metadata/Loader/XmlFileLoader.php#L143-L156 | train | php | Parses a metadata entry and adds it to the collection.
@param array $collection A collection of metadata
@param \DOMElement $node Element to parse that represents a Route
@param string $path Full path of the XML file being processed | protected function parseMetadata(array &$collection, \DOMElement $node, $path)
{
if ('' === ($id = $node->getAttribute('id')) || !$node->hasAttribute('type')) {
throw new \InvalidArgumentException(sprintf('The <route> element in file "%s" must have an "id" and a "type" attribute.', $path))... | Parses a metadata entry and adds it to the collection.
@param array $collection A collection of metadata
@param \DOMElement $node Element to parse that represents a Route
@param string $path Full path of the XML file being processed
protected function parseMetadata(array &$collection, \DOMEleme... | 196 | 256 | 578 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 60f4684591ae7016648462755cd3b4a68a9b3ad765a3ea247f0a7abf1e8970dc | MIT | permissive | https://github.com/harmony-project/modular-routing/blob/master/license |
0201115115c5b6a158817edc | harmony-project/modular-routing | source/Metadata/Loader/XmlFileLoader.php | XmlFileLoader.parseImport | https://github.com/harmony-project/modular-routing/blob/399bb427678ddc17c67295c738b96faea485e2d8/source/Metadata/Loader/XmlFileLoader.php#L168-L179 | train | php | Parses an import entry and adds the routes in the resource to the collection.
@param array $collection A collection of metadata
@param \DOMElement $node Element to parse that represents a Route
@param string $path Full path of the XML file being processed
@param string $file Loaded fi... | protected function parseImport(array &$collection, \DOMElement $node, $path, $file)
{
if ('' === $resource = $node->getAttribute('resource')) {
throw new \InvalidArgumentException(sprintf('The <import> element in file "%s" must have a "resource" attribute.', $path));
}
$ty... | Parses an import entry and adds the routes in the resource to the collection.
@param array $collection A collection of metadata
@param \DOMElement $node Element to parse that represents a Route
@param string $path Full path of the XML file being processed
@param string $file Loaded fi... | 195 | 386 | 502 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 80226db15d10c65de8fe148c739dd1e94a8015ef0c3897ef255c38e104daeefc | MIT | permissive | https://github.com/harmony-project/modular-routing/blob/master/license |
2371e994c10be5c30b76865e | nattreid/app-manager | src/Helpers/Info.php | Info.getPhpInfo | https://github.com/nattreid/app-manager/blob/7821d09a0b3e58ba9c6eb81d44e35aacce55de75/src/Helpers/Info.php#L34-L44 | train | php | Vrati vypis PHP info
@return string | protected function getPhpInfo(): string
{
ob_start();
phpinfo();
$result = ob_get_contents();
ob_end_clean();
$result = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $result);
$result = preg_replace('/,\s*/', ', ', $result);
return $result;
} | Vrati vypis PHP info
@return string
protected function getPhpInfo(): string
{
ob_start();
phpinfo();
$result = ob_get_contents();
ob_end_clean();
$result = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $result);
$result = preg_replace('/,\s*/', ', ', $result);
return $result;
} | 94 | 35 | 263 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | c2c1e42cb2474ac729908c4eb91ab2a53860857246a673e99f22edcccff108d3 | MIT | permissive | https://github.com/nattreid/app-manager/blob/master/LICENSE |
8fd03290c6c833c6c681e75a | nattreid/app-manager | src/Helpers/Info.php | Info.getSystem | https://github.com/nattreid/app-manager/blob/7821d09a0b3e58ba9c6eb81d44e35aacce55de75/src/Helpers/Info.php#L86-L113 | train | php | Vrati informace o systemu
@return Obj | protected function getSystem(): Obj
{
$system = new Obj;
$system->hostname = $this->readFile('/etc/hostname');
$system->ip = $this->getIp();
$system->distribution = Strings::replace($this->readCommand('lsb_release -d'), '/Description:\s/');
$system->kernel = $this->readCommand('uname -r') . ' ' . $this->rea... | Vrati informace o systemu
@return Obj
protected function getSystem(): Obj
{
$system = new Obj;
$system->hostname = $this->readFile('/etc/hostname');
$system->ip = $this->getIp();
$system->distribution = Strings::replace($this->readCommand('lsb_release -d'), '/Description:\s/');
$system->kernel = $this->rea... | 366 | 37 | 1,054 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 673fc19d85f38af5161100295879a201af028da22d5786461bbea3333df24026 | MIT | permissive | https://github.com/nattreid/app-manager/blob/master/LICENSE |
8fcd4c45a25230f6b1288126 | nattreid/app-manager | src/Helpers/Info.php | Info.getLoad | https://github.com/nattreid/app-manager/blob/7821d09a0b3e58ba9c6eb81d44e35aacce55de75/src/Helpers/Info.php#L128-L136 | train | php | Vrati vytizeni serveru
@return string|null | protected function getLoad(): ?string
{
$load = $this->readFileAsArray('/proc/loadavg', ' ');
if ($load) {
unset($load[3], $load[4]);
return implode(' ', $load);
}
return null;
} | Vrati vytizeni serveru
@return string|null
protected function getLoad(): ?string
{
$load = $this->readFileAsArray('/proc/loadavg', ' ');
if ($load) {
unset($load[3], $load[4]);
return implode(' ', $load);
}
return null;
} | 78 | 42 | 194 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 07527836e29b435be73b272e6daa9160c6210620187b41ccffb1e94f2be69679 | MIT | permissive | https://github.com/nattreid/app-manager/blob/master/LICENSE |
f35a2ea02c45d03cf02b107d | nattreid/app-manager | src/Helpers/Info.php | Info.getHardware | https://github.com/nattreid/app-manager/blob/7821d09a0b3e58ba9c6eb81d44e35aacce55de75/src/Helpers/Info.php#L142-L161 | train | php | Vrati informace o hardware
@return Obj | protected function getHardware(): Obj
{
$hardware = new Obj;
$product = $this->readFile('/sys/devices/virtual/dmi/id/product_name');
$board = $this->readFile('/sys/devices/virtual/dmi/id/board_name');
$bios = $this->readFile('/sys/devices/virtual/dmi/id/bios_version');
$biosDate = $this->readFile('/sys/devi... | Vrati informace o hardware
@return Obj
protected function getHardware(): Obj
{
$hardware = new Obj;
$product = $this->readFile('/sys/devices/virtual/dmi/id/product_name');
$board = $this->readFile('/sys/devices/virtual/dmi/id/board_name');
$bios = $this->readFile('/sys/devices/virtual/dmi/id/bios_version');
... | 234 | 38 | 701 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 236f7d22e914ffe1f047ea702f6c817b6c5043a300480a70fdcb16b9db66ffd7 | MIT | permissive | https://github.com/nattreid/app-manager/blob/master/LICENSE |
c48c75473aaac4c5ff4d53d7 | nattreid/app-manager | src/Helpers/Info.php | Info.getCpu | https://github.com/nattreid/app-manager/blob/7821d09a0b3e58ba9c6eb81d44e35aacce55de75/src/Helpers/Info.php#L167-L305 | train | php | Vrati informace o cpu
@return Obj[] | private function getCpu(): array
{
$result = [];
$cpuInfo = $this->readFile('/proc/cpuinfo');
if ($cpuInfo) {
$processors = preg_split('/\s?\n\s?\n/', trim($cpuInfo));
$procname = null;
foreach ($processors as $processor) {
$cpu = new Obj;
$proc = null;
$arch = null;
$details = preg_spli... | Vrati informace o cpu
@return Obj[]
private function getCpu(): array
{
$result = [];
$cpuInfo = $this->readFile('/proc/cpuinfo');
if ($cpuInfo) {
$processors = preg_split('/\s?\n\s?\n/', trim($cpuInfo));
$procname = null;
foreach ($processors as $processor) {
$cpu = new Obj;
$proc = null;
$... | 1,647 | 35 | 4,709 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | f4e5d34fa34c6ad2f5e76b5dbe07c02964a36ca7f4ab5ff76d11c29c136ffce7 | MIT | permissive | https://github.com/nattreid/app-manager/blob/master/LICENSE |
d4ad98026be7a189a3b7d887 | nattreid/app-manager | src/Helpers/Info.php | Info.getScsi | https://github.com/nattreid/app-manager/blob/7821d09a0b3e58ba9c6eb81d44e35aacce55de75/src/Helpers/Info.php#L311-L337 | train | php | Vrati informace o scsi
@return Obj[] | private function getScsi(): array
{
$get_type = false;
$device = null;
$scsi = [];
$data = $this->readFile('/proc/scsi/scsi');
if ($data !== null) {
$bufe = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY);
foreach ($bufe as $buf) {
if (preg_match('/Vendor: (.*) Model: (.*) Rev: (.*)/i', $buf, $... | Vrati informace o scsi
@return Obj[]
private function getScsi(): array
{
$get_type = false;
$device = null;
$scsi = [];
$data = $this->readFile('/proc/scsi/scsi');
if ($data !== null) {
$bufe = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY);
foreach ($bufe as $buf) {
if (preg_match('/Vendor: ... | 257 | 36 | 674 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 3ac9a865f69c4b743e1d0a70c7cb4e2ceee3cc695b1f79f6041d0e65382ebe5d | MIT | permissive | https://github.com/nattreid/app-manager/blob/master/LICENSE |
5be674f4ad111fc04d18628b | nattreid/app-manager | src/Helpers/Info.php | Info.getMemory | https://github.com/nattreid/app-manager/blob/7821d09a0b3e58ba9c6eb81d44e35aacce55de75/src/Helpers/Info.php#L343-L383 | train | php | Vrati informace o pameti
@return Obj|null | protected function getMemory(): ?Obj
{
$memory = null;
$meminfo = $this->readFile('/proc/meminfo');
if ($meminfo) {
$bufer = preg_split("/\n/", $meminfo, -1, PREG_SPLIT_NO_EMPTY);
$memory = new Obj;
foreach ($bufer as $buf) {
if (preg_match('/^MemTotal:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
$memor... | Vrati informace o pameti
@return Obj|null
protected function getMemory(): ?Obj
{
$memory = null;
$meminfo = $this->readFile('/proc/meminfo');
if ($meminfo) {
$bufer = preg_split("/\n/", $meminfo, -1, PREG_SPLIT_NO_EMPTY);
$memory = new Obj;
foreach ($bufer as $buf) {
if (preg_match('/^MemTotal:\s+... | 547 | 41 | 1,424 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | ab2f01edfdfc4094c3ccb554ffba5e6de3584e0a0cf4aabc13d84334ecec1f94 | MIT | permissive | https://github.com/nattreid/app-manager/blob/master/LICENSE |
0ab389039a54afd89756a437 | nattreid/app-manager | src/Helpers/Info.php | Info.getFileSystem | https://github.com/nattreid/app-manager/blob/7821d09a0b3e58ba9c6eb81d44e35aacce55de75/src/Helpers/Info.php#L389-L414 | train | php | Vrati informace o souborovem system
@return Obj[] | protected function getFileSystem(): array
{
$fileSystem = [];
$command = $this->readCommand('df -T');
if ($command) {
$bufe = preg_split("/\n/", $command, -1, PREG_SPLIT_NO_EMPTY);
unset($bufe[0]);
foreach ($bufe as $buf) {
$data = preg_split('/\s+/', $buf);
$mounted = new Obj;
$mounted->p... | Vrati informace o souborovem system
@return Obj[]
protected function getFileSystem(): array
{
$fileSystem = [];
$command = $this->readCommand('df -T');
if ($command) {
$bufe = preg_split("/\n/", $command, -1, PREG_SPLIT_NO_EMPTY);
unset($bufe[0]);
foreach ($bufe as $buf) {
$data = preg_split('/\s+... | 240 | 49 | 620 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 23d9ac9529e315eeee2bf77f7b26d2141404fc37fe843266ac6896258b8682ec | MIT | permissive | https://github.com/nattreid/app-manager/blob/master/LICENSE |
06a4a9180f7aa3187a8401a7 | nattreid/app-manager | src/Helpers/Info.php | Info.getNetwork | https://github.com/nattreid/app-manager/blob/7821d09a0b3e58ba9c6eb81d44e35aacce55de75/src/Helpers/Info.php#L420-L453 | train | php | Vrati informace o siti
@return Obj[] | protected function getNetwork(): array
{
$network = [];
$data = $this->readFile('/proc/net/dev');
if ($data !== null) {
$bufe = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY);
unset($bufe[0], $bufe[1]);
foreach ($bufe as $buf) {
list($dev_name, $stats_list) = preg_split('/:/', $buf, 2);
$st... | Vrati informace o siti
@return Obj[]
protected function getNetwork(): array
{
$network = [];
$data = $this->readFile('/proc/net/dev');
if ($data !== null) {
$bufe = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY);
unset($bufe[0], $bufe[1]);
foreach ($bufe as $buf) {
list($dev_name, $stats_list)... | 438 | 36 | 1,116 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 47ad8c015aac31f02d9531250c96302774cbf0354afedc7df21da88fc2e1cbb3 | MIT | permissive | https://github.com/nattreid/app-manager/blob/master/LICENSE |
13db8c231323f9a354bc9a80 | nonetallt/jinitialize-core | src/Helpers/Strings.php | Strings.cutAfter | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/Helpers/Strings.php#L9-L21 | train | php | /* str_after | public static function cutAfter(string $subject, string $until)
{
$stopAt = strpos($subject, $until);
$cut = null;
if($stopAt === false) {
$cut = substr($subject, 0);
}
else {
$cut = substr($subject, 0, $stopAt);
}
return $cut;
} | /* str_after
public static function cutAfter(string $subject, string $until)
{
$stopAt = strpos($subject, $until);
$cut = null;
if($stopAt === false) {
$cut = substr($subject, 0);
}
else {
$cut = substr($subject, 0, $stopAt);
}
return... | 86 | 12 | 318 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 3168884605c0991c732372bb7714f2df3797a614935f58ffb098f9e45e91f5c2 | MIT | permissive | https://github.com/nonetallt/jinitialize-core/blob/master/LICENSE |
8122d769e8e01cd861680161 | nonetallt/jinitialize-core | src/Helpers/Strings.php | Strings.cutUntil | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/Helpers/Strings.php#L24-L37 | train | php | /* str_until | public static function cutUntil(string $subject, string $until, bool $includeStop = true)
{
$startAt = strpos($subject, $until);
$cut = null;
if($startAt === false) {
$cut = substr($subject, 0);
}
else {
if(! $includeStop) $startAt++;
$cut... | /* str_until
public static function cutUntil(string $subject, string $until, bool $includeStop = true)
{
$startAt = strpos($subject, $until);
$cut = null;
if($startAt === false) {
$cut = substr($subject, 0);
}
else {
if(! $includeStop) $startAt++;
... | 101 | 12 | 387 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | bbce6dd2ab67f6a2ac3c56875896c71f9dd3d9af775d2e5a7d7cd7e697aec2df | MIT | permissive | https://github.com/nonetallt/jinitialize-core/blob/master/LICENSE |
c68859403e97a7e9ddde8b29 | nonetallt/jinitialize-core | src/Helpers/Strings.php | Strings.replaceFirst | https://github.com/nonetallt/jinitialize-core/blob/284fbd72b7c1d6f5f8f265dfe2589c0d99b6a88f/src/Helpers/Strings.php#L68-L87 | train | php | /* str_replace_first | public static function replaceFirst(string $target, string $replacement, string $subject)
{
$pos = strpos($subject, $target);
/* No operations needed if target does not exist */
if($pos === false) return $subject;
$str = '';
for($n = 0; $n < strlen($subject); $n++) {
... | /* str_replace_first
public static function replaceFirst(string $target, string $replacement, string $subject)
{
$pos = strpos($subject, $target);
/* No operations needed if target does not exist */
if($pos === false) return $subject;
$str = '';
for($n = 0; $n < strlen($s... | 150 | 20 | 570 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | bce8c1d3b9b0a36ab3a39107c292f7d009fc9800871522bb79b9e7f7d2969820 | MIT | permissive | https://github.com/nonetallt/jinitialize-core/blob/master/LICENSE |
b5654b7ef2f4f2bdc7426c2e | yujin1st/yii2-user | models/User.php | User.register | https://github.com/yujin1st/yii2-user/blob/b404c77acf4a96f0cdf9bb0af5c8d62bcae3946f/models/User.php#L282-L307 | train | php | This method is used to register new user account. If Module::enableConfirmation is set true, this method
will generate new confirmation token and use mailer to send it to the user.
@return bool | public function register() {
if ($this->getIsNewRecord() == false) {
throw new \RuntimeException('Calling "' . __CLASS__ . '::' . __METHOD__ . '" on existing user');
}
$this->confirmTime = $this->module->enableConfirmation ? null : time();
$this->password = $this->module->enableGeneratingPassword... | This method is used to register new user account. If Module::enableConfirmation is set true, this method
will generate new confirmation token and use mailer to send it to the user.
@return bool
public function register() {
if ($this->getIsNewRecord() == false) {
throw new \RuntimeException('Calling "' . __C... | 261 | 194 | 842 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | ed8b792b659fa7848a4e1dde8f19374624af6fe11b696f3d3bd0728a6aba2ce7 | MIT | permissive | https://github.com/yujin1st/yii2-user/blob/master/LICENSE.md |
5fba256d55c129b8db81f936 | yujin1st/yii2-user | models/User.php | User.attemptConfirmation | https://github.com/yujin1st/yii2-user/blob/b404c77acf4a96f0cdf9bb0af5c8d62bcae3946f/models/User.php#L316-L339 | train | php | Attempts user confirmation.
@param string $code Confirmation code.
@return boolean | public function attemptConfirmation($code) {
$token = Token::find()->where([
'userId' => $this->id,
'code' => $code,
'type' => Token::TYPE_CONFIRMATION,
])->one();
if ($token instanceof Token && !$token->isExpired) {
$token->delete();
if (($success = $this->confirm())) {
... | Attempts user confirmation.
@param string $code Confirmation code.
@return boolean
public function attemptConfirmation($code) {
$token = Token::find()->where([
'userId' => $this->id,
'code' => $code,
'type' => Token::TYPE_CONFIRMATION,
])->one();
if ($token instanceof Token && !$token-... | 228 | 84 | 847 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 44947f67dbaf23ab669551ea37bf673905fd7bb92722b60ba8daf7f71e249a34 | MIT | permissive | https://github.com/yujin1st/yii2-user/blob/master/LICENSE.md |
3c47545f4fe9978a3ec359bf | yujin1st/yii2-user | models/User.php | User.assignRoles | https://github.com/yujin1st/yii2-user/blob/b404c77acf4a96f0cdf9bb0af5c8d62bcae3946f/models/User.php#L471-L474 | train | php | Assign roles to new user
Overwrite this method for own purposes | public function assignRoles() {
$auth = Yii::$app->authManager;
$auth->assign($auth->getRole(Access::ROLE_USER), $this->id);
} | Assign roles to new user
Overwrite this method for own purposes
public function assignRoles() {
$auth = Yii::$app->authManager;
$auth->assign($auth->getRole(Access::ROLE_USER), $this->id);
} | 54 | 63 | 136 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 77b8d9de71323a9a5e4b3cac5d5c4ce41048e0297b5fe24e79bfacaaad569daf | MIT | permissive | https://github.com/yujin1st/yii2-user/blob/master/LICENSE.md |
dfcc108fce37cb3c242b735c | yujin1st/yii2-user | models/User.php | User.findIdentityByUsernameOrEmail | https://github.com/yujin1st/yii2-user/blob/b404c77acf4a96f0cdf9bb0af5c8d62bcae3946f/models/User.php#L538-L543 | train | php | Finds a user by the given username or email.
@param string $usernameOrEmail Username or email to be used on search.
@return User | public static function findIdentityByUsernameOrEmail($usernameOrEmail) {
if (filter_var($usernameOrEmail, FILTER_VALIDATE_EMAIL)) {
return self::findUserByEmail($usernameOrEmail);
}
return User::findIdentityByUsername($usernameOrEmail);
} | Finds a user by the given username or email.
@param string $usernameOrEmail Username or email to be used on search.
@return User
public static function findIdentityByUsernameOrEmail($usernameOrEmail) {
if (filter_var($usernameOrEmail, FILTER_VALIDATE_EMAIL)) {
return self::findUserByEmail($usernameOrEmail... | 87 | 131 | 258 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | c812cc000f63a3ca78d3d152bc1168215db3c83be95d8e3f331917a682410bc6 | MIT | permissive | https://github.com/yujin1st/yii2-user/blob/master/LICENSE.md |
7dcf6c6b2fc9412aa7393921 | jitesoft/php-math | src/VectorMath.php | VectorMath.mul | https://github.com/jitesoft/php-math/blob/1775055e5a14ef30c7df0deeb1fe1ff0775bb581/src/VectorMath.php#L18-L32 | train | php | Vector multiplication.
@param Vector $vector
@param Vector|float $value
@return Vector | public static function mul(Vector $vector, $value) : Vector {
$type = get_class($vector);
$out = new $type();
$count = count($out);
if ($value instanceof Vector === false) {
$value = new $type(...array_fill(0, $count , $value));
}
for ($i=$count;$i-->0;) {
... | Vector multiplication.
@param Vector $vector
@param Vector|float $value
@return Vector
public static function mul(Vector $vector, $value) : Vector {
$type = get_class($vector);
$out = new $type();
$count = count($out);
if ($value instanceof Vector === false) {
$value = ne... | 128 | 87 | 406 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 499c29fd7f070727b1063eb68c06a238eb12c50da107ba1feb388a3ee076334a | MIT | permissive | https://github.com/jitesoft/php-math/blob/master/LICENSE |
a98db02efa66087bb4752c0d | jitesoft/php-math | src/VectorMath.php | VectorMath.dot | https://github.com/jitesoft/php-math/blob/1775055e5a14ef30c7df0deeb1fe1ff0775bb581/src/VectorMath.php#L109-L116 | train | php | Dot product of two vectors/points.
@param Vector $vector1
@param Vector $vector2
@return float | public static function dot(Vector $vector1, Vector $vector2) : float {
$count = count($vector1);
$value = 0;
for ($i=0;$i<$count;$i++) {
$value += ($vector1[$i] * $vector2[$i]);
}
return $value;
} | Dot product of two vectors/points.
@param Vector $vector1
@param Vector $vector2
@return float
public static function dot(Vector $vector1, Vector $vector2) : float {
$count = count($vector1);
$value = 0;
for ($i=0;$i<$count;$i++) {
$value += ($vector1[$i] * $vector2[$i]);
}... | 96 | 95 | 252 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 3514f7feb3db8166195ba3f6387577b370bee7d19a4fb800e954850cbdebb2a4 | MIT | permissive | https://github.com/jitesoft/php-math/blob/master/LICENSE |
fbcd93367535039e2e4630d2 | jitesoft/php-math | src/VectorMath.php | VectorMath.cross | https://github.com/jitesoft/php-math/blob/1775055e5a14ef30c7df0deeb1fe1ff0775bb581/src/VectorMath.php#L125-L131 | train | php | Cross product of two vectors.
@param Vector3D $value1
@param Vector3D $value2
@return Vector3D | public static function cross(Vector3D $value1, Vector3D $value2) : Vector3D {
return new Vector3D(
($value1->getY() * $value2->getZ()) - ($value1->getZ() * $value2->getY()),
-(($value1->getX() * $value2->getZ()) - ($value1->getZ() * $value2->getX())),
($value1->getX() * $valu... | Cross product of two vectors.
@param Vector3D $value1
@param Vector3D $value2
@return Vector3D
public static function cross(Vector3D $value1, Vector3D $value2) : Vector3D {
return new Vector3D(
($value1->getY() * $value2->getZ()) - ($value1->getZ() * $value2->getY()),
-(($value1->getX(... | 150 | 95 | 386 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 699113de3aa2420674e3496fcc0a4121f0b72b1f2856be98f03934de1e9164bc | MIT | permissive | https://github.com/jitesoft/php-math/blob/master/LICENSE |
97bf62dfec9b9bf64b65ca99 | jitesoft/php-math | src/VectorMath.php | VectorMath.distance | https://github.com/jitesoft/php-math/blob/1775055e5a14ef30c7df0deeb1fe1ff0775bb581/src/VectorMath.php#L140-L142 | train | php | Distance between two vectors/points.
@param Vector $value1
@param Vector $value2
@return float | public static function distance(Vector $value1, Vector $value2) : float {
return sqrt(self::distance2($value1, $value2));
} | Distance between two vectors/points.
@param Vector $value1
@param Vector $value2
@return float
public static function distance(Vector $value1, Vector $value2) : float {
return sqrt(self::distance2($value1, $value2));
} | 56 | 95 | 135 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 429d6feaa80d8d36b9ae1d64ba880f077c8b770337316fc902c2c454385cfe5e | MIT | permissive | https://github.com/jitesoft/php-math/blob/master/LICENSE |
9e720d081514146be3e5180c | jitesoft/php-math | src/VectorMath.php | VectorMath.distance2 | https://github.com/jitesoft/php-math/blob/1775055e5a14ef30c7df0deeb1fe1ff0775bb581/src/VectorMath.php#L151-L158 | train | php | Squared distance between two vectors/points.
@param Vector $vector1
@param Vector $vector2
@return float | public static function distance2(Vector $vector1, Vector $vector2) : float {
$value = 0;
$count = count($vector1);
for ($i = 0;$i<$count;$i++) {
$value += ($vector1[$i] - $vector2[$i]) * ($vector1[$i] - $vector2[$i]);
}
return $value;
} | Squared distance between two vectors/points.
@param Vector $vector1
@param Vector $vector2
@return float
public static function distance2(Vector $vector1, Vector $vector2) : float {
$value = 0;
$count = count($vector1);
for ($i = 0;$i<$count;$i++) {
$value += ($vector1[$i] - $vecto... | 112 | 105 | 292 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | d92e8ce34feebcc35c86344db694263d809b990c794d04fdbdebe382bb4104a7 | MIT | permissive | https://github.com/jitesoft/php-math/blob/master/LICENSE |
d902dd8dd448e2660392397f | sqrt-pro/Form | src/SQRT/Form/Element/Checkbox.php | Checkbox.render | https://github.com/sqrt-pro/Form/blob/90f79ea77e2b7291730f4c7fbde3d1a4016a9c80/src/SQRT/Form/Element/Checkbox.php#L17-L39 | train | php | TODO: $attr не используется
@return \SQRT\Tag\Checkbox|CheckboxListing | public function render($attr = null)
{
if ($this->getOptions()) {
$tag = new CheckboxListing(
$this->getInputName(),
$this->getOptions(),
$this->getValue()
);
if ($this->getIgnoreOptionsKeys()) {
$tag->setIgnoreOptionsKeys(true);
}
} else {
$tag =... | TODO: $attr не используется
@return \SQRT\Tag\Checkbox|CheckboxListing
public function render($attr = null)
{
if ($this->getOptions()) {
$tag = new CheckboxListing(
$this->getInputName(),
$this->getOptions(),
$this->getValue()
);
if ($this->getIgnoreOptionsKeys()) {
... | 155 | 70 | 510 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | d4f3b36e079cee731f4c914f7078ca0642fa1c96268c6375f3e3e02625ad5850 | MIT | permissive | https://github.com/sqrt-pro/Form/blob/master/LICENSE |
e2e986e2e1d6f03aff2e216e | nours/TableBundle | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | https://github.com/nours/TableBundle/blob/0fb5bd7cc13008fb7890037b1a1ccb02d047c329/DependencyInjection/Configuration.php#L18-L53 | train | php | {@inheritDoc} | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('nours_table');
$rootNode
->children()
->arrayNode('extensions')
->addDefaultsIfNotSet()
->children()
... | {@inheritDoc}
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('nours_table');
$rootNode
->children()
->arrayNode('extensions')
->addDefaultsIfNotSet()
->childre... | 285 | 13 | 1,634 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 13ec55b62c579f36e7c5c40e5569a4413dda6e5105ac25450513a71e062e247b | MIT | permissive | https://github.com/nours/TableBundle/blob/master/LICENSE |
81f32f6e4ad63dad27930ad4 | jivoo/http | src/Route/PathRoute.php | PathRoute.dispatch | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Route/PathRoute.php#L51-L57 | train | php | {@inheritdoc} | public function dispatch(\Jivoo\Http\ActionRequest $request, \Psr\Http\Message\ResponseInterface $response)
{
$location = new Message\Uri($request->pathToString($this->path));
$location = $location->withQuery(http_build_query($this->query))
->withFragment($this->fragment);
return... | {@inheritdoc}
public function dispatch(\Jivoo\Http\ActionRequest $request, \Psr\Http\Message\ResponseInterface $response)
{
$location = new Message\Uri($request->pathToString($this->path));
$location = $location->withQuery(http_build_query($this->query))
->withFragment($this->fragment);... | 85 | 13 | 372 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 2c14c8f9598874194ec9cab613d51ee17835d49d4bda5fc4471960bb6ee3f962 | MIT | permissive | https://github.com/nielssp/jivoo-http/blob/master/LICENSE |
732f0503d4698679fc6df2ba | zepi/turbo-base | Zepi/Api/Rest/src/Helper/RestHelper.php | RestHelper.sendRequest | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Api/Rest/src/Helper/RestHelper.php#L85-L117 | train | php | Sends the RestRequest to the endpoint
@access public
@param \Zepi\Api\AccessControl\Entity\ApiKey $apiKey
@param \Zepi\Api\Rest\Entity\Request $request
@return \Zepi\Api\Rest\Entity\Response
@throws \Zepi\Api\Rest\Exception Cannot send REST request. | public function sendRequest(ApiKey $apiKey, RestRequest $request)
{
$hmac = $this->generateHmac($apiKey->getPrivateKey(), $request->getEndpoint(), array_merge($request->getQueryData(), $request->getPostData()));
$client = new Client([
'base_uri' => $request->getHost()
]);
... | Sends the RestRequest to the endpoint
@access public
@param \Zepi\Api\AccessControl\Entity\ApiKey $apiKey
@param \Zepi\Api\Rest\Entity\Request $request
@return \Zepi\Api\Rest\Entity\Response
@throws \Zepi\Api\Rest\Exception Cannot send REST request.
public function sendRequest(ApiKey $apiKey, RestRequest $request)
... | 323 | 251 | 1,143 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 641078ba4246ce394c754f55291f63dc6b4adeeb22fb8e2f73037a742bb6242d | MIT | permissive | https://github.com/zepi/turbo-base/blob/master/LICENSE |
40b7302d87654ff7681106b0 | zepi/turbo-base | Zepi/Api/Rest/src/Helper/RestHelper.php | RestHelper.prepareResponse | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Api/Rest/src/Helper/RestHelper.php#L126-L138 | train | php | Prepares the response object for the given raw response object
@param mixed $responseRaw
@param \Zepi\Api\Rest\Entity\Request
@return \Zepi\Api\Rest\Entity\Response | protected function prepareResponse($responseRaw, RestRequest $request)
{
$body = (string) $responseRaw->getBody();
$parsedResult = json_decode($body);
if ($parsedResult == false) {
$parsedResult = new \stdClass();
}
$response = new RestResponse($... | Prepares the response object for the given raw response object
@param mixed $responseRaw
@param \Zepi\Api\Rest\Entity\Request
@return \Zepi\Api\Rest\Entity\Response
protected function prepareResponse($responseRaw, RestRequest $request)
{
$body = (string) $responseRaw->getBody();
$parsedRe... | 132 | 165 | 423 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 98c7827a0b9916c7d13c078c286b5f305bd22eebf6a3454ac0df3b69bd145ac7 | MIT | permissive | https://github.com/zepi/turbo-base/blob/master/LICENSE |
cd90b7f50e4e6294b43acf40 | zepi/turbo-base | Zepi/Api/Rest/src/Helper/RestHelper.php | RestHelper.sendResponse | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Api/Rest/src/Helper/RestHelper.php#L148-L172 | train | php | Send the api result to the client
@access public
@param \Zepi\Turbo\Request\WebRequest $request
@param \Zepi\Turbo\Response\Response $response
@param array $result | public function sendResponse(WebRequest $request, Response $response, $result)
{
$dataType = $request->getHeader('Accept');
switch ($dataType) {
case 'text/xml':
$xml = new \SimpleXMLElement('<root/>');
$this->fillXml($xml, $result);
... | Send the api result to the client
@access public
@param \Zepi\Turbo\Request\WebRequest $request
@param \Zepi\Turbo\Response\Response $response
@param array $result
public function sendResponse(WebRequest $request, Response $response, $result)
{
$dataType = $request->getHeader('Accept');
s... | 204 | 164 | 844 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 0d2e0fed036116e0fb75924774bd902aad60056a87a86e8e42bd8dcc52ff8cbf | MIT | permissive | https://github.com/zepi/turbo-base/blob/master/LICENSE |
d0f94788320904f991f88fb2 | zepi/turbo-base | Zepi/Api/Rest/src/Helper/RestHelper.php | RestHelper.fillXml | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Api/Rest/src/Helper/RestHelper.php#L181-L196 | train | php | Builds a xml string out of the given array
@access public
@param \SimpleXMLElement $element
@param array|object $data | protected function fillXml(\SimpleXMLElement $element, $data)
{
foreach ($data as $key => $value) {
if (is_array($value) || is_object($value)) {
if (!is_numeric($key)) {
$child = $element->addChild($key);
} else {
$child = $... | Builds a xml string out of the given array
@access public
@param \SimpleXMLElement $element
@param array|object $data
protected function fillXml(\SimpleXMLElement $element, $data)
{
foreach ($data as $key => $value) {
if (is_array($value) || is_object($value)) {
if (!is_numeric... | 138 | 118 | 512 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 7d2a849462850657e9e0ec74179b8521d3c90edc7b25b4eb68bcf0ca31a42971 | MIT | permissive | https://github.com/zepi/turbo-base/blob/master/LICENSE |
c7aadee692b255ff7686dcff | zepi/turbo-base | Zepi/Api/Rest/src/Helper/RestHelper.php | RestHelper.validateRequest | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Api/Rest/src/Helper/RestHelper.php#L209-L220 | train | php | Validates the request and returns the access entity
if everything is correct or false if the request is wrong
@access public
@param \Zepi\Api\AccessControl\Entity\ApiKey $apiKey
@param string $hmac
@param string $route
@param array $data
@return false|\Zepi\Api\AccessControl\Entity\Token | public function validateRequest(ApiKey $apiKey, $hmac, $route, $data)
{
// Regenerate the hmac
$regeneratedHmac = $this->generateHmac($apiKey->getPrivateKey(), $route, $data);
// Verify the hmac and the time
if ($hmac === $regeneratedHmac) {
return true;
... | Validates the request and returns the access entity
if everything is correct or false if the request is wrong
@access public
@param \Zepi\Api\AccessControl\Entity\ApiKey $apiKey
@param string $hmac
@param string $route
@param array $data
@return false|\Zepi\Api\AccessControl\Entity\Token
public function validateReque... | 160 | 289 | 358 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | e39b227f7cb0e27a97a9e79d7afa89bf510d6b5a78ba0ac82e7843a9adaf40ac | MIT | permissive | https://github.com/zepi/turbo-base/blob/master/LICENSE |
43baa47a8b0b2b0381b175a9 | zepi/turbo-base | Zepi/Api/Rest/src/Helper/RestHelper.php | RestHelper.generateHmac | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Api/Rest/src/Helper/RestHelper.php#L231-L236 | train | php | Generates the hmac for the given data
@access protected
@param string $privateKey
@param string $requestedRoute
@param array $data
@return string | protected function generateHmac($privateKey, $requestedRoute, $data)
{
$completeString = $requestedRoute . json_encode($data);
return hash_hmac('sha256', $completeString, $privateKey);
} | Generates the hmac for the given data
@access protected
@param string $privateKey
@param string $requestedRoute
@param array $data
@return string
protected function generateHmac($privateKey, $requestedRoute, $data)
{
$completeString = $requestedRoute . json_encode($data);
return hash_hmac('sha256... | 84 | 146 | 211 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 677567c5d721317ea36b8944a3261c8ef16987d32a4f062df2ba715835a6f0af | MIT | permissive | https://github.com/zepi/turbo-base/blob/master/LICENSE |
64ffc94b0386ab86635678a8 | as3io/modlr-api-jsonapiorg | src/Normalizer.php | Normalizer.extractProperties | https://github.com/as3io/modlr-api-jsonapiorg/blob/f53163c315a6a7be09e514a4c81af24aa665634b/src/Normalizer.php#L42-L48 | train | php | {@inheritDoc} | protected function extractProperties(array $rawPayload, EntityMetadata $metadata)
{
$data = $rawPayload['data'];
$attributes = $this->extractAttributes($data, $metadata);
$relationships = $this->extractRelationships($data, $metadata);
return array_merge($attributes, $relationships);
... | {@inheritDoc}
protected function extractProperties(array $rawPayload, EntityMetadata $metadata)
{
$data = $rawPayload['data'];
$attributes = $this->extractAttributes($data, $metadata);
$relationships = $this->extractRelationships($data, $metadata);
return array_merge($attributes, $r... | 72 | 13 | 325 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 2c7c997edeb1c1f3372f2b0d2fbeae36c33ee2cb91adf1293f080f55022195d2 | Apache-2.0 | permissive | https://github.com/as3io/modlr-api-jsonapiorg/blob/master/LICENSE |
9f47cc6d3e2c15dc442d2cd4 | as3io/modlr-api-jsonapiorg | src/Normalizer.php | Normalizer.extractAttributes | https://github.com/as3io/modlr-api-jsonapiorg/blob/f53163c315a6a7be09e514a4c81af24aa665634b/src/Normalizer.php#L57-L74 | train | php | Extracts the model's attributes, per JSON API spec.
@param array $data
@param EntityMetadata $metadata
@return array | protected function extractAttributes(array $data, EntityMetadata $metadata)
{
$flattened = [];
if (!isset($data['attributes']) || !is_array($data['attributes'])) {
return $data['attributes'] = [];
}
$keyMap = array_flip(array_keys($data['attributes']));
foreach (... | Extracts the model's attributes, per JSON API spec.
@param array $data
@param EntityMetadata $metadata
@return array
protected function extractAttributes(array $data, EntityMetadata $metadata)
{
$flattened = [];
if (!isset($data['attributes']) || !is_array($data['attributes'])) {
... | 184 | 133 | 666 | CodeSearchNet permissive-repo filter (dataset-level) | code_search_net | 2026-12-05 | 2d6484ec35f22cb728e96c40b94833fc9e760eb57748ce31a2c424b58aa59bd0 | Apache-2.0 | permissive | https://github.com/as3io/modlr-api-jsonapiorg/blob/master/LICENSE |
End of preview. Expand in Data Studio
CodeSearchNet PHP — permissive licences only
Working copy (2026-12-05). Derived from the official
code-search-net/code_search_net
php configuration, keeping only repositories whose audited SPDX licence is
permissive.
- 318,394 rows, 3,861 repositories
- 259,632,086 characters, 60,277,723 tokens
(tiktoken
cl100k_base) - parquet
154,971,768bytes (zstd), 20 columns - splits: train 284,653 · validation 14,417 · test 19,324
- removed 97,255 non-permissive rows and 162,469 rows without a detected licence.
- audit cap: 5,000 repos audited (80.9% of rows); 0 selected repos (0 rows) not audited and dropped.
Full datasheet: datasheet.md.
Licences (rows)
| SPDX | rows | % |
|---|---|---|
MIT |
252,270 | 79.2% |
Apache-2.0 |
30,778 | 9.7% |
BSD-3-Clause |
29,518 | 9.3% |
BSD-2-Clause |
4,102 | 1.3% |
ISC |
615 | 0.2% |
WTFPL |
608 | 0.2% |
Unlicense |
408 | 0.1% |
BSL-1.0 |
50 | 0.0% |
CC0-1.0 |
45 | 0.0% |
Schema
id, repo, path, func_name, url, split, language, docstring, code, text,
token_count, doc_chars, code_chars, license_basis, source, added,
record_sha256, license, license_class, license_source
text = docstring + \n\n + code. id is unique. record_sha256 is the
canonical per-row SHA-256.
Rights
- Every retained row has an audited permissive SPDX licence in
license(license_class == "permissive",license_source= GitHub licence URL). - No copyleft and no
NOASSERTION/unknown. - Permissive is not obligation-free: Apache-2.0 requires NOTICE/attribution; MIT/BSD require the copyright notice. This is not legal advice.
Not checked
- Whether GitHub's LICENSE-file detection matches the repo's actual terms.
- Notice/attribution preservation for Apache-2.0/BSD rows.
- Cross-corpus dedup against other code corpora.
- PII in code/docstrings; no scrubber was run.
Authors
Piotr Styła (SlayerLab / Fabryka AI), 2026. See CITATION.cff.
Citation
If you use this dataset, cite it via CITATION.cff (or the Hugging Face
dataset page). Upstream code should be cited/attributed via the repo and
url fields.
Dataset licence
Curation, selection and metadata: CC-BY-4.0 (see LICENSE). Code and
documentation remain under their upstream licences, recorded per row in
license / license_source; see NOTICE, ATTRIBUTION.md and LICENSES/.
- Downloads last month
- -