repo_name stringlengths 2 55 | dataset stringclasses 1
value | owner stringlengths 3 31 | lang stringclasses 10
values | func_name stringlengths 1 104 | code stringlengths 20 96.7k | docstring stringlengths 1 4.92k | url stringlengths 94 241 | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|
fictioneer | github_2023 | Tetrakern | php | fictioneer_build_customize_css | function fictioneer_build_customize_css( $context = null ) {
// --- Setup -----------------------------------------------------------------
$file_path = fictioneer_get_theme_cache_dir( 'build_customize_css' ) . '/customize.css';
$site_width = (int) get_theme_mod( 'site_width', FICTIONEER_DEFAULT_SITE_WIDTH );
... | /**
* Builds customization stylesheet
*
* @since 5.11.0
*
* @param string|null $context Optional. In which context the stylesheet created,
* for example 'preview' for the Customizer.
*/ | https://github.com/Tetrakern/fictioneer/blob/75bab85d81d1d55f1a293ba9220605a91d026f59/includes/functions/_customizer.php#L550-L1057 | 75bab85d81d1d55f1a293ba9220605a91d026f59 |
fictioneer | github_2023 | Tetrakern | php | fictioneer_save_word_count | function fictioneer_save_word_count( $post_id ) {
// Prevent multi-fire
if ( fictioneer_multi_save_guard( $post_id ) ) {
return;
}
// Count
$word_count = fictioneer_count_words( $post_id );
// Save
update_post_meta( $post_id, '_word_count', $word_count );
} | // =============================================================================
// STORE WORD COUNT AS CUSTOM FIELD
// =============================================================================
/**
* Store word count of posts
*
* @since 3.0.0
* @since 5.23.0 - Account for non-Latin scripts.
* @since 5.25.0 - S... | https://github.com/Tetrakern/fictioneer/blob/75bab85d81d1d55f1a293ba9220605a91d026f59/includes/functions/_service-posts.php#L59-L70 | 75bab85d81d1d55f1a293ba9220605a91d026f59 |
fictioneer | github_2023 | Tetrakern | php | fictioneer_maintenance_mode | function fictioneer_maintenance_mode() {
if ( get_option( 'fictioneer_enable_maintenance_mode' ) && ! is_customize_preview() ) {
if ( ! current_user_can( 'edit_themes' ) || ! is_user_logged_in() ) {
$note = get_option( 'fictioneer_phrase_maintenance' );
$note = ! empty( $note ) ? $note : __( 'Website ... | // =============================================================================
// MAINTENANCE MODE
// =============================================================================
/**
* Toggle maintenance mode from settings with message
*
* @since 5.0.0
* @since 5.12.0 - Exclude Customizer preview.
*/ | https://github.com/Tetrakern/fictioneer/blob/75bab85d81d1d55f1a293ba9220605a91d026f59/includes/functions/_setup-wordpress.php#L14-L23 | 75bab85d81d1d55f1a293ba9220605a91d026f59 |
fictioneer | github_2023 | Tetrakern | php | fictioneer_is_commenting_disabled | function fictioneer_is_commenting_disabled( $post_id = null ) {
// Setup
$post_id = $post_id ?? get_the_ID();
// Return immediately if...
if (
get_option( 'fictioneer_disable_commenting' ) ||
get_post_meta( $post_id, 'fictioneer_disable_commenting', true )
) {
return true;
}
... | /**
* Check whether commenting is disabled
*
* Differs from comments_open() in the regard that it does not hide the whole
* comment section but does not allow new comments to be posted.
*
* @since 5.0.0
*
* @param int|null $post_id Post ID the comments are for. Defaults to current post ID.
*... | https://github.com/Tetrakern/fictioneer/blob/75bab85d81d1d55f1a293ba9220605a91d026f59/includes/functions/_utility.php#L2236-L2258 | 75bab85d81d1d55f1a293ba9220605a91d026f59 |
fictioneer | github_2023 | Tetrakern | php | fictioneer_settings_capability_card | function fictioneer_settings_capability_card( $title, $caps, $role ) {
// Start HTML ---> ?>
<div class="fictioneer-card">
<div class="fictioneer-card__wrapper">
<h3 class="fictioneer-card__header"><?php echo $title; ?></h3>
<div class="fictioneer-card__content">
<div class="fictioneer-card_... | // =============================================================================
// SETTINGS CONTENT HELPERS
// =============================================================================
/**
* Renders a role settings capability card
*
* @since 5.6.0
*
* @param string $title The title of the card.
* @param arr... | https://github.com/Tetrakern/fictioneer/blob/75bab85d81d1d55f1a293ba9220605a91d026f59/includes/functions/settings/_settings.php#L407-L443 | 75bab85d81d1d55f1a293ba9220605a91d026f59 |
fictioneer | github_2023 | Tetrakern | php | fictioneer_tools_duplicate_story_tags_to_genres | function fictioneer_tools_duplicate_story_tags_to_genres() {
// Verify request
fictioneer_verify_admin_action( 'fictioneer_duplicate_story_tags_to_genres' );
// Relay
fictioneer_convert_taxonomies( 'fcn_story', 'fcn_genre', 'post_tag', true );
// Log
fictioneer_log( __( 'Story tags duplicated as genres.',... | // =============================================================================
// STORY TOOLS ACTIONS
// =============================================================================
/**
* Duplicate story tags to genres
*
* @since 5.2.5
*/ | https://github.com/Tetrakern/fictioneer/blob/75bab85d81d1d55f1a293ba9220605a91d026f59/includes/functions/settings/_settings_actions.php#L430-L442 | 75bab85d81d1d55f1a293ba9220605a91d026f59 |
fictioneer | github_2023 | Tetrakern | php | fictioneer_delete_null_option | function fictioneer_delete_null_option( $option, $old_value, $value ) {
// Theme option?
if (
! array_key_exists( $option, FICTIONEER_OPTIONS['booleans'] ) &&
! array_key_exists( $option, FICTIONEER_OPTIONS['strings'] )
) {
return;
}
// Delete empty options
if ( empty( $value ) ) {
delete_o... | // =============================================================================
// CLEANUP
// =============================================================================
/**
* When a fictioneer option is updated as empty, the option is deleted
*
* @since 5.7.5
*
* @param string $option The option name.
* @p... | https://github.com/Tetrakern/fictioneer/blob/75bab85d81d1d55f1a293ba9220605a91d026f59/repo/graveyard/discarded.php#L670-L683 | 75bab85d81d1d55f1a293ba9220605a91d026f59 |
ai-commit | github_2023 | guanguans | php | CommitCommand.handle | public function handle(): void
{
collect()
->tap(function (): void {
$this->createProcess(['git', 'rev-parse', '--is-inside-work-tree'])->mustRun();
})
->tap(function () use (&$cachedDiff): void {
$cachedDiff = $this->option('diff') ?: $thi... | /**
* @psalm-suppress InvalidArgument
*
* @throws \Exception
*/ | https://github.com/guanguans/ai-commit/blob/d7b9595fede325aef270f569f29a1b33e5486d99/app/Commands/CommitCommand.php#L65-L152 | d7b9595fede325aef270f569f29a1b33e5486d99 |
HeoMusic | github_2023 | zhheo | php | ClassLoader.addClassMap | public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
} | /**
* @param string[] $classMap Class to filename map
* @psalm-param array<string, string> $classMap
*
* @return void
*/ | https://github.com/zhheo/HeoMusic/blob/9204f94de6a89516ac0fadd6fe2b483d01b002b4/meting-api/vendor/composer/ClassLoader.php#L165-L172 | 9204f94de6a89516ac0fadd6fe2b483d01b002b4 |
vip-block-data-api | github_2023 | Automattic | php | GraphQLApiV2.flatten_blocks | public static function flatten_blocks( $blocks, $parent_id = null ) {
$flattened_blocks = [];
foreach ( $blocks as $block ) {
// Gather innerBlocks from current block
$inner_blocks = $block['innerBlocks'] ?? [];
unset( $block['innerBlocks'] );
// Set parent ID on current block
$block['parentId'] = ... | /**
* Flatten blocks recursively.
*
* @param array $blocks the inner blocks in the block.
* @param string $parent_id Optional. ID of the parent block that $blocks belong to.
*
* @return array
*/ | https://github.com/Automattic/vip-block-data-api/blob/be82f1fa726a0a392a311c207bc30a018bb6e5ed/src/graphql/graphql-api-v2.php#L112-L129 | be82f1fa726a0a392a311c207bc30a018bb6e5ed |
folio | github_2023 | laravel | php | FolioRoutes.load | protected function load(): void
{
if ($this->loaded) {
return;
}
if (File::exists($this->cachedFolioRoutesPath)) {
$cache = File::getRequire($this->cachedFolioRoutesPath);
if (isset($cache['version']) && (int) $cache['version'] === static::$version) {
... | /**
* Load the routes into memory.
*/ | https://github.com/laravel/folio/blob/fc48190e08f166b0532da0adbf22f2112f01c19e/src/FolioRoutes.php#L71-L107 | fc48190e08f166b0532da0adbf22f2112f01c19e |
requirepin | github_2023 | ikechukwukalu | php | PinService.isArrestedRequestValid | public function isArrestedRequestValid(Request $request): bool
{
$param = config('requirepin.param', '_uuid');
$requirePin = RequirePin::where('user_id', Auth::guard(config('requirepin.auth_guard', 'web'))->user()->id)
->where('route_arrested', $request->path())
... | /**
* Error Response For Pin Authentication.
*
* @param \Illuminate\Http\Request $request
*
* @return bool
*/ | https://github.com/ikechukwukalu/requirepin/blob/4d7e690f03d0b4374ec057b1c3f5762d671a9bbd/src/Services/PinService.php#L257-L272 | 4d7e690f03d0b4374ec057b1c3f5762d671a9bbd |
wizwizxui-timebot | github_2023 | wizwizdev | php | QRimage.image | private static function image($frame, $pixelPerPoint = 4, $outerFrame = 4)
{
$h = count($frame);
$w = strlen($frame[0]);
$imgW = $w + 2*$outerFrame;
$imgH = $h + 2*$outerFrame;
$base_image =ImageCreate($imgW, $imgH);
... | //---------------------------------------------------------------------- | https://github.com/wizwizdev/wizwizxui-timebot/blob/549a9986f6b02858584a03d90b80155d2937a15b/phpqrcode/phpqrcode.php#L977-L1005 | 549a9986f6b02858584a03d90b80155d2937a15b |
pan | github_2023 | netcccyun | php | RequestCore.add_header | public function add_header($key, $value)
{
$this->request_headers[$key] = $value;
return $this;
} | /**
* Add a custom HTTP header to the cURL request.
*
* @param string $key (Required) The custom HTTP header to set.
* @param mixed $value (Required) The value to assign to the custom HTTP header.
* @return $this A reference to the current instance.
*/ | https://github.com/netcccyun/pan/blob/4f2867f186a0bcf9b710d0ee6a5049e4c4709348/includes/OSS/Http/RequestCore.php#L294-L298 | 4f2867f186a0bcf9b710d0ee6a5049e4c4709348 |
pan | github_2023 | netcccyun | php | RequestCore.set_curlopts | public function set_curlopts($curlopts)
{
$this->curlopts = $curlopts;
return $this;
} | /**
* Set additional CURLOPT settings. These will merge with the default settings, and override if
* there is a duplicate.
*
* @param array $curlopts (Optional) A set of key-value pairs that set `CURLOPT` options. These will merge with the existing CURLOPTs, and ones passed here will override the de... | https://github.com/netcccyun/pan/blob/4f2867f186a0bcf9b710d0ee6a5049e4c4709348/includes/OSS/Http/RequestCore.php#L369-L373 | 4f2867f186a0bcf9b710d0ee6a5049e4c4709348 |
pan | github_2023 | netcccyun | php | ServerSideEncryptionConfig.__construct | public function __construct($sseAlgorithm = null, $kmsMasterKeyID = null)
{
$this->sseAlgorithm = $sseAlgorithm;
$this->kmsMasterKeyID = $kmsMasterKeyID;
} | /**
* ServerSideEncryptionConfig constructor.
* @param null $sseAlgorithm
* @param null $kmsMasterKeyID
*/ | https://github.com/netcccyun/pan/blob/4f2867f186a0bcf9b710d0ee6a5049e4c4709348/includes/OSS/Model/ServerSideEncryptionConfig.php#L21-L25 | 4f2867f186a0bcf9b710d0ee6a5049e4c4709348 |
pan | github_2023 | netcccyun | php | ServerSideEncryptionConfig.parseFromXml | public function parseFromXml($strXml)
{
$xml = simplexml_load_string($strXml);
if (!isset($xml->ApplyServerSideEncryptionByDefault)) return;
foreach ($xml->ApplyServerSideEncryptionByDefault as $default) {
foreach ($default as $key => $value) {
if ($key === 'SSEAl... | /**
* Parse ServerSideEncryptionConfig from the xml.
*
* @param string $strXml
* @throws OssException
* @return null
*/ | https://github.com/netcccyun/pan/blob/4f2867f186a0bcf9b710d0ee6a5049e4c4709348/includes/OSS/Model/ServerSideEncryptionConfig.php#L34-L48 | 4f2867f186a0bcf9b710d0ee6a5049e4c4709348 |
pan | github_2023 | netcccyun | php | GetCorsResult.parseDataFromResponse | protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$config = new CorsConfig();
$config->parseFromXml($content);
return $config;
} | /**
* @return CorsConfig
*/ | https://github.com/netcccyun/pan/blob/4f2867f186a0bcf9b710d0ee6a5049e4c4709348/includes/OSS/Result/GetCorsResult.php#L12-L18 | 4f2867f186a0bcf9b710d0ee6a5049e4c4709348 |
pan | github_2023 | netcccyun | php | GetRefererResult.isResponseOk | protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
return true;
}
return false;
} | /**
* Judged according to the return HTTP status code, [200-299] that is OK, get the bucket configuration interface,
* 404 is also considered a valid response
*
* @return bool
*/ | https://github.com/netcccyun/pan/blob/4f2867f186a0bcf9b710d0ee6a5049e4c4709348/includes/OSS/Result/GetRefererResult.php#L33-L40 | 4f2867f186a0bcf9b710d0ee6a5049e4c4709348 |
pan | github_2023 | netcccyun | php | AliyunGreen.buildCanonicalHeaders | private function buildCanonicalHeaders()
{
$sortMap = array();
foreach ($this->headers as $headerKey => $headerValue) {
$key = strtolower($headerKey);
if (strpos($key, 'x-acs-') === 0) {
$sortMap[$key] = $headerValue;
}
}
ksort($sortMap);
$headerString = '';
foreach ($sortMap as $sortMapKey =>... | /**
* @return string
*/ | https://github.com/netcccyun/pan/blob/4f2867f186a0bcf9b710d0ee6a5049e4c4709348/includes/lib/AliyunGreen.php#L266-L281 | 4f2867f186a0bcf9b710d0ee6a5049e4c4709348 |
pan | github_2023 | netcccyun | php | InstalledVersions.getVersion | public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['version'])) {
return null;
... | /**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/ | https://github.com/netcccyun/pan/blob/4f2867f186a0bcf9b710d0ee6a5049e4c4709348/includes/vendor/composer/InstalledVersions.php#L168-L183 | 4f2867f186a0bcf9b710d0ee6a5049e4c4709348 |
pan | github_2023 | netcccyun | php | JsonLocationTest.testVisitsLocation | public function testVisitsLocation()
{
$location = new JsonLocation();
$parameter = new Parameter([
'name' => 'val',
'sentAs' => 'vim',
'filters' => ['strtoupper']
]);
$response = new Response(200, [], '{"vim":"bar"}');
$result = new Re... | /**
* @group ResponseLocation
*/ | https://github.com/netcccyun/pan/blob/4f2867f186a0bcf9b710d0ee6a5049e4c4709348/includes/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/JsonLocationTest.php#L24-L37 | 4f2867f186a0bcf9b710d0ee6a5049e4c4709348 |
pan | github_2023 | netcccyun | php | Client.request | public function request($method, $uri = '', array $options = [])
{
$options[RequestOptions::SYNCHRONOUS] = true;
return $this->requestAsync($method, $uri, $options)->wait();
} | /**
* Create and send an HTTP request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well.
*
* @param string $method HTTP method.
* @param st... | https://github.com/netcccyun/pan/blob/4f2867f186a0bcf9b710d0ee6a5049e4c4709348/includes/vendor/guzzlehttp/guzzle/src/Client.php#L179-L183 | 4f2867f186a0bcf9b710d0ee6a5049e4c4709348 |
pan | github_2023 | netcccyun | php | HandlerStack.remove | public function remove($remove)
{
$this->cached = null;
$idx = is_callable($remove) ? 0 : 1;
$this->stack = array_values(array_filter(
$this->stack,
function ($tuple) use ($idx, $remove) {
return $tuple[$idx] !== $remove;
}
));
... | /**
* Remove a middleware by instance or name from the stack.
*
* @param callable|string $remove Middleware to remove by instance or name.
*/ | https://github.com/netcccyun/pan/blob/4f2867f186a0bcf9b710d0ee6a5049e4c4709348/includes/vendor/guzzlehttp/guzzle/src/HandlerStack.php#L178-L188 | 4f2867f186a0bcf9b710d0ee6a5049e4c4709348 |
pan | github_2023 | netcccyun | php | MultipartStream.getHeaders | private function getHeaders(array $headers)
{
$str = '';
foreach ($headers as $key => $value) {
$str .= "{$key}: {$value}\r\n";
}
return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n";
} | /**
* Get the headers needed before transferring the content of a POST file
*/ | https://github.com/netcccyun/pan/blob/4f2867f186a0bcf9b710d0ee6a5049e4c4709348/includes/vendor/guzzlehttp/psr7/src/MultipartStream.php#L55-L63 | 4f2867f186a0bcf9b710d0ee6a5049e4c4709348 |
bladestan | github_2023 | bladestan | php | MyViewComponent.render | public function render()
{
return view('component', [
'foo' => 'bar',
]);
} | /**
* @return Closure|\Illuminate\Contracts\View\View|string
*/ | https://github.com/bladestan/bladestan/blob/b65375103c977e1a3357a9a92309a8a3a44686bb/tests/Rules/Fixture/laravel-component-function.php#L15-L20 | b65375103c977e1a3357a9a92309a8a3a44686bb |
writeout.ai | github_2023 | beyondcode | php | RouteServiceProvider.configureRateLimiting | protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});
} | /**
* Configure the rate limiters for the application.
*
* @return void
*/ | https://github.com/beyondcode/writeout.ai/blob/e9a5b58fd7fcbdb9ee5182cc3bbea948c6df868d/app/Providers/RouteServiceProvider.php#L46-L51 | e9a5b58fd7fcbdb9ee5182cc3bbea948c6df868d |
chatwire | github_2023 | theokafadaris | php | ProfileUpdateRequest.rules | public function rules(): array
{
return [
'name' => ['string', 'max:255'],
'email' => ['email', 'max:255', Rule::unique(User::class)->ignore($this->user()->id)],
];
} | /**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/ | https://github.com/theokafadaris/chatwire/blob/f7b2bd526d9600abbb25179eb221f9439d98ba69/app/Http/Requests/ProfileUpdateRequest.php#L16-L22 | f7b2bd526d9600abbb25179eb221f9439d98ba69 |
rconfig | github_2023 | rconfig | php | App.basePath | public static function basePath($path = '')
{
/** @var \Illuminate\Foundation\Application $instance */
return $instance->basePath($path);
} | /**
* Get the base path of the Laravel installation.
*
* @param string $path
* @return string
* @static
*/ | https://github.com/rconfig/rconfig/blob/0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7/_ide_helper.php#L137-L141 | 0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7 |
rconfig | github_2023 | rconfig | php | App.makeWith | public static function makeWith($abstract, $parameters = [])
{ //Method inherited from \Illuminate\Container\Container
/** @var \Illuminate\Foundation\Application $instance */
return $instance->makeWith($abstract, $parameters);
} | /**
* An alias function name for make().
*
* @param string|callable $abstract
* @param array $parameters
* @return mixed
* @throws \Illuminate\Contracts\Container\BindingResolutionException
* @static
*/ | https://github.com/rconfig/rconfig/blob/0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7/_ide_helper.php#L1337-L1341 | 0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7 |
rconfig | github_2023 | rconfig | php | Artisan.all | public static function all()
{ //Method inherited from \Illuminate\Foundation\Console\Kernel
/** @var \App\Console\Kernel $instance */
return $instance->all();
} | /**
* Get all of the commands registered with the console.
*
* @return array
* @static
*/ | https://github.com/rconfig/rconfig/blob/0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7/_ide_helper.php#L1736-L1740 | 0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7 |
rconfig | github_2023 | rconfig | php | Gate.inspect | public static function inspect($ability, $arguments = [])
{
/** @var \Illuminate\Auth\Access\Gate $instance */
return $instance->inspect($ability, $arguments);
} | /**
* Inspect the user for the given ability.
*
* @param string $ability
* @param array|mixed $arguments
* @return \Illuminate\Auth\Access\Response
* @static
*/ | https://github.com/rconfig/rconfig/blob/0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7/_ide_helper.php#L7475-L7479 | 0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7 |
rconfig | github_2023 | rconfig | php | Mail.queued | public static function queued($mailable, $callback = null)
{
/** @var \Illuminate\Support\Testing\Fakes\MailFake $instance */
return $instance->queued($mailable, $callback);
} | /**
* Get all of the queued mailables matching a truth-test callback.
*
* @param string|\Closure $mailable
* @param callable|null $callback
* @return \Illuminate\Support\Collection
* @static
*/ | https://github.com/rconfig/rconfig/blob/0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7/_ide_helper.php#L8990-L8994 | 0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7 |
rconfig | github_2023 | rconfig | php | Request.getMimeTypes | public static function getMimeTypes($format)
{ //Method inherited from \Symfony\Component\HttpFoundation\Request
return \Illuminate\Http\Request::getMimeTypes($format);
} | /**
* Gets the mime types associated with the format.
*
* @return string[]
* @static
*/ | https://github.com/rconfig/rconfig/blob/0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7/_ide_helper.php#L11741-L11744 | 0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7 |
rconfig | github_2023 | rconfig | php | URL.action | public static function action($action, $parameters = [], $absolute = true)
{
/** @var \Illuminate\Routing\UrlGenerator $instance */
return $instance->action($action, $parameters, $absolute);
} | /**
* Get the URL to a controller action.
*
* @param string|array $action
* @param mixed $parameters
* @param bool $absolute
* @return string
* @throws \InvalidArgumentException
* @static
*/ | https://github.com/rconfig/rconfig/blob/0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7/_ide_helper.php#L16289-L16293 | 0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7 |
rconfig | github_2023 | rconfig | php | CronSchedule.natlangElementYear | final private function natlangElementYear($elem)
{
if (! $elem['hasInterval']) {
return $elem['number1'];
}
$txt = $this->natlangApply('elemYear: every_consecutive_year'.($elem['interval'] == 1 ? '' : '_plural'), $elem['interval']);
if (($elem['number1'] != $this->_cronM... | //
// Function: natlangElementYear
//
// Description: Converts an entry from the year specification to natural language.
// | https://github.com/rconfig/rconfig/blob/0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7/app/CustomClasses/CronSchedule.php#L1196-L1208 | 0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7 |
rconfig | github_2023 | rconfig | php | AddBatchUuidColumnToActivityLogTable.up | public function up()
{
Schema::table('activity_log', function (Blueprint $table) {
$table->uuid('batch_uuid')->nullable()->after('properties');
});
Schema::table('activity_log_archives', function (Blueprint $table) {
$table->uuid('batch_uuid')->nullable()->after('prop... | /**
* Run the migrations.
*
* @return void
*/ | https://github.com/rconfig/rconfig/blob/0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7/database/migrations/2022_04_13_090632_add_batch_uuid_column_to_activity_log_table.php#L14-L22 | 0263d71b5ee5b8e3c3e3febbbde7a79df0f7a1c7 |
qdrant-php | github_2023 | hkulekci | php | Snapshots.create | public function create(array $queryParams = []): Response
{
return $this->client->execute(
$this->createRequest('POST', '/snapshots' . $this->queryBuild($queryParams))
);
} | /**
* # Create storage snapshot
* Create new snapshot of the whole storage
*
* @throws InvalidArgumentException
*/ | https://github.com/hkulekci/qdrant-php/blob/9be8fa3c52514c35f3e6c7db1c34f43335891fa2/src/Endpoints/Snapshots.php#L34-L39 | 9be8fa3c52514c35f3e6c7db1c34f43335891fa2 |
dujiaoka | github_2023 | hiouttime | php | GoodsService.detail | public function detail(int $id)
{
$goods = Goods::query()
->with(['coupon','goods_sub'])
->withCount(['carmis' => function($query) {
$query->where('status', Carmis::STATUS_UNSOLD);
}])->where('id', $id)->first();
return $goods;
} | /**
* 商品详情
*
* @param int $id 商品id
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object|null
*
* @author assimon<ashang@utf8.hk>
* @copyright assimon<ashang@utf8.hk>
* @link http://utf8.hk/
*/ | https://github.com/hiouttime/dujiaoka/blob/51538b6a7e74a67a4f92a242b1e3c6799b64f5ca/app/Service/GoodsService.php#L64-L72 | 51538b6a7e74a67a4f92a242b1e3c6799b64f5ca |
filament-jobs-monitor | github_2023 | croustibat | php | FilamentJobsMonitorPlugin.getId | public function getId(): string
{
return 'filament-jobs-monitor';
} | /**
* Get the plugin identifier.
*/ | https://github.com/croustibat/filament-jobs-monitor/blob/6543ae2d5767de9a45f56d1396042dc3f6d08793/src/FilamentJobsMonitorPlugin.php#L72-L75 | 6543ae2d5767de9a45f56d1396042dc3f6d08793 |
laravel | github_2023 | lmsqueezy | php | SubscriptionFactory.expired | public function expired(): self
{
return $this->state([
'status' => Subscription::STATUS_EXPIRED,
]);
} | /**
* Mark the subscription as expired
*/ | https://github.com/lmsqueezy/laravel/blob/689941de4960cccf53ebcd0e8486b016d42ddfac/database/factories/SubscriptionFactory.php#L124-L129 | 689941de4960cccf53ebcd0e8486b016d42ddfac |
langchain-php | github_2023 | kambo-1st | php | TextLoader.load | public function load(): array
{
$text = file_get_contents($this->filePath->getRealPath());
$metadata = ['source' => $this->filePath->getRealPath()];
return [new Document(pageContent:$text, metadata: $metadata)];
} | /**
* Load from file path.
*
* @return Document[]
*/ | https://github.com/kambo-1st/langchain-php/blob/48f9db4b841a72eb2a42377758477a201c64a0b4/src/DocumentLoaders/TextLoader.php#L37-L42 | 48f9db4b841a72eb2a42377758477a201c64a0b4 |
commentify | github_2023 | usamamuneerchaudhary | php | Comment.newFactory | protected static function newFactory(): CommentFactory
{
return CommentFactory::new();
} | /**
* @return CommentFactory
*/ | https://github.com/usamamuneerchaudhary/commentify/blob/c70cfe8cd4cc1cd759e61b5e83726d8e951af2c7/src/Models/Comment.php#L78-L81 | c70cfe8cd4cc1cd759e61b5e83726d8e951af2c7 |
TwoNav | github_2023 | tznb1 | php | edit_category | function edit_category(){
if(empty($_POST['name'])){
msg(-1,'分类名称不能为空');
}elseif(!preg_match('/^(fa fa-|layui-icon layui-icon-)([A-Za-z0-9]|-)+$/',$_POST['font_icon'])){
$_POST['font_icon'] = 'fa fa-star-o';
}
//父分类不能是自己
if($_POST['id'] == $_POST['fid']){
msg(-1,'父分类不能是自己');
... | //编辑分类 | https://github.com/tznb1/TwoNav/blob/f87af906d9761178f63ae79ae762ac9a7090dca7/system/api_compatible.php#L223-L278 | f87af906d9761178f63ae79ae762ac9a7090dca7 |
TwoNav | github_2023 | tznb1 | php | update_db | function update_db($table,$data,$where,$rp = []){
global $db;
try {
$db->update($table,$data,$where);
if(empty($rp)){
return true;
}else{
msg($rp[0],$rp[1]);
}
}catch (Exception $e) {
if(Debug){
msgA(['code'=>-1,'msg'=>'更新数据失败','Mes... | //更新 $rp = [1,'成功']; | https://github.com/tznb1/TwoNav/blob/f87af906d9761178f63ae79ae762ac9a7090dca7/system/public.php#L101-L117 | f87af906d9761178f63ae79ae762ac9a7090dca7 |
TwoNav | github_2023 | tznb1 | php | is_apply | function is_apply(){
$apply_user = unserialize( get_db("user_config", "v", ["k" => "apply","uid"=>UID]));
return ($GLOBALS['global_config']['apply'] == 1 && $apply_user['apply'] > 0);
} | //是否启用收录 | https://github.com/tznb1/TwoNav/blob/f87af906d9761178f63ae79ae762ac9a7090dca7/system/templates.php#L145-L148 | f87af906d9761178f63ae79ae762ac9a7090dca7 |
laravel-db-auditor | github_2023 | vcian | php | DisplayController.getTableData | public function getTableData(string $tableName): JsonResponse
{
return response()->json(array(
"data" => $this->tableRules($tableName)
));
} | /**
* Get table data
* @param string $tableName
* @return JsonResponse
*/ | https://github.com/vcian/laravel-db-auditor/blob/50fc3e559ac32889ef3d610dd5938a7f09dd0e6f/src/Controllers/DisplayController.php#L57-L62 | 50fc3e559ac32889ef3d610dd5938a7f09dd0e6f |
avscms | github_2023 | avscms | php | HTMLPurifier_LanguageFactory.getFallbackFor | public function getFallbackFor($code)
{
$this->loadLanguage($code);
return $this->cache[$code]['fallback'];
} | /**
* Returns the fallback language for language
* @note Loads the original language into cache
* @param string $code language code
* @return string|bool
*/ | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/classes/htmlpurifier/HTMLPurifier/LanguageFactory.php#L136-L140 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | HTMLPurifier_Lexer.CDATACallback | protected static function CDATACallback($matches)
{
// not exactly sure why the character set is needed, but whatever
return htmlspecialchars($matches[1], ENT_COMPAT, 'UTF-8');
} | /**
* Callback function for escapeCDATA() that does the work.
*
* @warning Though this is public in order to let the callback happen,
* calling it directly is not recommended.
* @param array $matches PCRE matches array, with index 0 the entire match
* and 1 the in... | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/classes/htmlpurifier/HTMLPurifier/Lexer.php#L290-L294 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | HTMLPurifier_ConfigSchema_InterchangeBuilder._findUnused | protected function _findUnused($hash)
{
$accessed = $hash->getAccessed();
foreach ($hash as $k => $v) {
if (!isset($accessed[$k])) {
trigger_error("String hash key '$k' not used by builder", E_USER_NOTICE);
}
}
} | /**
* Triggers errors for any unused keys passed in the hash; such keys
* may indicate typos, missing values, etc.
* @param HTMLPurifier_StringHash $hash Hash to check.
*/ | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/classes/htmlpurifier/HTMLPurifier/ConfigSchema/InterchangeBuilder.php#L215-L223 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | HTMLPurifier_Printer_HTMLDefinition.heavyHeader | protected function heavyHeader($text, $num = 1)
{
$ret = '';
$ret .= $this->start('tr');
$ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy'));
$ret .= $this->end('tr');
return $ret;
} | /**
* Creates a heavy header row
* @param string $text
* @param int $num
* @return string
*/ | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/classes/htmlpurifier/HTMLPurifier/Printer/HTMLDefinition.php#L314-L321 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | ADODB_Active_Record.UseDefaultValues | static function UseDefaultValues($bool=null)
{
global $ADODB_ACTIVE_DEFVALS;
if (isset($bool)) {
$ADODB_ACTIVE_DEFVALS = $bool;
}
return $ADODB_ACTIVE_DEFVALS;
} | // CFR: class name when in a relationship | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/include/adodb/adodb-active-recordx.inc.php#L106-L113 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | ADODB_Cache_File.readcache | function &readcache($filename, &$err, $secs2cache, $rsClass) {
$rs = csv2rs($filename,$err,$secs2cache,$rsClass);
return $rs;
} | // load serialised recordset and unserialise it | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/include/adodb/adodb.inc.php#L337-L340 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | ADOConnection.GetActiveRecordsClass | function GetActiveRecordsClass(
$class, $table,$whereOrderBy=false,$bindarr=false, $primkeyArr=false,
$extra=array(),
$relations=array())
{
global $_ADODB_ACTIVE_DBS;
## reduce overhead of adodb.inc.php -- moved to adodb-active-record.inc.php
## if adodb-active-recordx is loaded -- should be no issue as... | /**
* GetActiveRecordsClass Performs an 'ALL' query
*
* @param mixed $class This string represents the class of the current active record
* @param mixed $table Table used by the active record object
* @param mixed $whereOrderBy Where, order, by clauses
* @param mixed $bindarr
* @param mixed $primkeyArr
... | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/include/adodb/adodb.inc.php#L2373-L2385 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | ADODB_csv.SelectLimit | function SelectLimit($sql, $nrows = -1, $offset = -1, $inputarr = false, $secs2cache = 0)
{
global $ADODB_FETCH_MODE;
$nrows = (int) $nrows;
$offset = (int) $offset;
$url = $this->_url.'?sql='.urlencode($sql)."&nrows=$nrows&fetch=".
(($this->fetchMode !== false)?$this->fetchMode : $ADODB_FETCH_MODE).
"&... | // parameters use PostgreSQL convention, not MySQL | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/include/adodb/drivers/adodb-csv.inc.php#L84-L118 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | ADODB_odbtp.Parameter | function Parameter(&$stmt, &$var, $name, $isOutput=false, $maxLen=0, $type=0)
{
if ( $this->odbc_driver == ODB_DRIVER_JET ) {
$name = '['.$name.']';
if( !$type && $this->_useUnicodeSQL
&& @odbtp_param_bindtype($stmt[1], $name) == ODB_CHAR )
{
$type = ODB_WCHAR;
}
}
else {
$name = '@'.$name... | /*
Usage:
$stmt = $db->PrepareSP('SP_RUNSOMETHING'); -- takes 2 params, @myid and @group
# note that the parameter does not have @ in front!
$db->Parameter($stmt,$id,'myid');
$db->Parameter($stmt,$group,'group',false,64);
$db->Parameter($stmt,$group,'photo',false,100000,ODB_BINARY);
$db->Execute($stmt);
... | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/include/adodb/drivers/adodb-odbtp.inc.php#L511-L525 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | PHPMailer.encodeHeader | public function encodeHeader($str, $position = 'text')
{
$matchcount = 0;
switch (strtolower($position)) {
case 'phrase':
if (!preg_match('/[\200-\377]/', $str)) {
// Can't use addslashes as we don't know the value of magic_quotes_sybase
... | /**
* Encode a header value (not including its label) optimally.
* Picks shortest of Q, B, or none. Result includes folding if needed.
* See RFC822 definitions for phrase, comment and text positions.
*
* @param string $str The header value to encode
* @param string $position What cont... | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/include/phpmailer/PHPMailer.php#L3043-L3117 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | PHPMailer.hasMultiBytes | public function hasMultiBytes($str)
{
if (function_exists('mb_strlen')) {
return strlen($str) > mb_strlen($str, $this->CharSet);
}
// Assume no multibytes (we can't handle without mbstring functions anyway)
return false;
} | /**
* Check if a string contains multi-byte characters.
*
* @param string $str multi-byte text to wrap encode
*
* @return bool
*/ | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/include/phpmailer/PHPMailer.php#L3126-L3134 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | PHPMailer.encodeQP | public function encodeQP($string)
{
return static::normalizeBreaks(quoted_printable_encode($string));
} | /**
* Encode a string in quoted-printable format.
* According to RFC2045 section 6.7.
*
* @param string $string The text to encode
*
* @return string
*/ | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/include/phpmailer/PHPMailer.php#L3200-L3203 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | PHPMailer.lang | protected function lang($key)
{
if (count($this->language) < 1) {
$this->setLanguage('en'); // set the default language
}
if (array_key_exists($key, $this->language)) {
if ('smtp_connect_failed' == $key) {
//Include a link to troubleshooting docs on S... | /**
* Get an error message in the current language.
*
* @param string $key
*
* @return string
*/ | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/include/phpmailer/PHPMailer.php#L3646-L3665 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | Smarty.setEscapeHtml | public function setEscapeHtml($escape_html)
{
$this->escape_html = $escape_html;
} | /**
* @param boolean $escape_html
*/ | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/include/smarty/libs/Smarty.class.php#L1120-L1123 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | smarty_modifiercompiler_count_words | function smarty_modifiercompiler_count_words($params)
{
if (Smarty::$_MBSTRING) {
// return 'preg_match_all(\'#[\w\pL]+#' . Smarty::$_UTF8_MODIFIER . '\', ' . $params[0] . ', $tmp)';
// expression taken from http://de.php.net/manual/en/function.str-word-count.php#85592
return 'preg_match_all... | /**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty count_words modifier plugin
* Type: modifier
* Name: count_words
* Purpose: count the number of words in a text
*
* @link http://www.smarty.net/manual/en/language.modifier.count.words.php count_words (... | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/include/smarty/libs/plugins/modifiercompiler.count_words.php#L22-L32 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | smarty_modifiercompiler_from_charset | function smarty_modifiercompiler_from_charset($params)
{
if (!Smarty::$_MBSTRING) {
// FIXME: (rodneyrehm) shouldn't this throw an error?
return $params[ 0 ];
}
if (!isset($params[ 1 ])) {
$params[ 1 ] = '"ISO-8859-1"';
}
return 'mb_convert_encoding(' . $params[ 0 ] . ', "'... | /**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty from_charset modifier plugin
* Type: modifier
* Name: from_charset
* Purpose: convert character encoding from $charset to internal encoding
*
* @author Rodney Rehm
*
* @param array $params parameters
... | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/include/smarty/libs/plugins/modifiercompiler.from_charset.php#L21-L33 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | Smarty_Internal_Compile_Function.compile | public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
{
// check and get attributes
$_attr = $this->getAttributes($compiler, $args);
if ($_attr[ 'nocache' ] === true) {
$compiler->trigger_template_error('nocache option not allowed', null, true);
... | /**
* Compiles code for the {function} tag
*
* @param array $args array with attributes from parser
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
*
* @return bool true
* @throws \SmartyCompilerException
*/ | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/include/smarty/libs/sysplugins/smarty_internal_compile_function.php#L53-L72 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
avscms | github_2023 | avscms | php | Smarty_Internal_Debug.end_cache | public function end_cache(Smarty_Internal_Template $template)
{
$key = $this->get_key($template);
$this->template_data[ $this->index ][ $key ][ 'cache_time' ] +=
microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_time' ];
} | /**
* End logging of cache time
*
* @param \Smarty_Internal_Template $template cached template
*/ | https://github.com/avscms/avscms/blob/3908822ae404c0761df6e9c58ece543baedd4e11/include/smarty/libs/sysplugins/smarty_internal_debug.php#L166-L171 | 3908822ae404c0761df6e9c58ece543baedd4e11 |
larachain | github_2023 | alnutile | php | Handler.register | public function register(): void
{
$this->reportable(function (Throwable $e) {
//
});
} | /**
* Register the exception handling callbacks for the application.
*/ | https://github.com/alnutile/larachain/blob/0b6e2d3c4b4006dc1c18bb2114f906305ce0da3b/app/Exceptions/Handler.php#L42-L47 | 0b6e2d3c4b4006dc1c18bb2114f906305ce0da3b |
larachain | github_2023 | alnutile | php | ProjectPolicy.viewAny | public function viewAny(User $user): bool
{
return false;
} | /**
* Determine whether the user can view any models.
*/ | https://github.com/alnutile/larachain/blob/0b6e2d3c4b4006dc1c18bb2114f906305ce0da3b/app/Policies/ProjectPolicy.php#L14-L17 | 0b6e2d3c4b4006dc1c18bb2114f906305ce0da3b |
zendit-php-sdk | github_2023 | zenditplatform | php | DtoESIMPlan.setStatus | public function setStatus($status)
{
if (is_null($status)) {
throw new \InvalidArgumentException('non-nullable status cannot be null');
}
$allowedValues = $this->getStatusAllowableValues();
if (!in_array($status, $allowedValues, true)) {
throw new \InvalidArgu... | /**
* Sets status
*
* @param string $status status
*
* @return self
*/ | https://github.com/zenditplatform/zendit-php-sdk/blob/b8512157cdbbcec5f99a92154d21665fd971b12a/lib/Model/DtoESIMPlan.php#L562-L580 | b8512157cdbbcec5f99a92154d21665fd971b12a |
zendit-php-sdk | github_2023 | zenditplatform | php | DtoESimPurchase.setShortNotes | public function setShortNotes($short_notes)
{
if (is_null($short_notes)) {
throw new \InvalidArgumentException('non-nullable short_notes cannot be null');
}
$this->container['short_notes'] = $short_notes;
return $this;
} | /**
* Sets short_notes
*
* @param string $short_notes short_notes
*
* @return self
*/ | https://github.com/zenditplatform/zendit-php-sdk/blob/b8512157cdbbcec5f99a92154d21665fd971b12a/lib/Model/DtoESimPurchase.php#L1143-L1151 | b8512157cdbbcec5f99a92154d21665fd971b12a |
zendit-php-sdk | github_2023 | zenditplatform | php | DtoPrice.openAPIFormats | public static function openAPIFormats()
{
return self::$openAPIFormats;
} | /**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/ | https://github.com/zenditplatform/zendit-php-sdk/blob/b8512157cdbbcec5f99a92154d21665fd971b12a/lib/Model/DtoPrice.php#L99-L102 | b8512157cdbbcec5f99a92154d21665fd971b12a |
zendit-php-sdk | github_2023 | zenditplatform | php | DtoTopupOffer.isNullable | public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
} | /**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/ | https://github.com/zenditplatform/zendit-php-sdk/blob/b8512157cdbbcec5f99a92154d21665fd971b12a/lib/Model/DtoTopupOffer.php#L185-L188 | b8512157cdbbcec5f99a92154d21665fd971b12a |
zendit-php-sdk | github_2023 | zenditplatform | php | DtoTopupPurchase.getDataGb | public function getDataGb()
{
return $this->container['data_gb'];
} | /**
* Gets data_gb
*
* @return float
*/ | https://github.com/zenditplatform/zendit-php-sdk/blob/b8512157cdbbcec5f99a92154d21665fd971b12a/lib/Model/DtoTopupPurchase.php#L770-L773 | b8512157cdbbcec5f99a92154d21665fd971b12a |
zendit-php-sdk | github_2023 | zenditplatform | php | DtoTopupPurchaseMakeInput.setIfExists | private function setIfExists(string $variableName, array $fields, $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$... | /**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param arr... | https://github.com/zenditplatform/zendit-php-sdk/blob/b8512157cdbbcec5f99a92154d21665fd971b12a/lib/Model/DtoTopupPurchaseMakeInput.php#L260-L267 | b8512157cdbbcec5f99a92154d21665fd971b12a |
zendit-php-sdk | github_2023 | zenditplatform | php | DtoTopupPurchaseResponse.getModelName | public function getModelName()
{
return self::$openAPIModelName;
} | /**
* The original name of the model.
*
* @return string
*/ | https://github.com/zenditplatform/zendit-php-sdk/blob/b8512157cdbbcec5f99a92154d21665fd971b12a/lib/Model/DtoTopupPurchaseResponse.php#L205-L208 | b8512157cdbbcec5f99a92154d21665fd971b12a |
zendit-php-sdk | github_2023 | zenditplatform | php | DtoTopupPurchaseResponse.listInvalidProperties | public function listInvalidProperties()
{
$invalidProperties = [];
if ($this->container['status'] === null) {
$invalidProperties[] = "'status' can't be null";
}
if ($this->container['transaction_id'] === null) {
$invalidProperties[] = "'transaction_id' can't ... | /**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/ | https://github.com/zenditplatform/zendit-php-sdk/blob/b8512157cdbbcec5f99a92154d21665fd971b12a/lib/Model/DtoTopupPurchaseResponse.php#L253-L264 | b8512157cdbbcec5f99a92154d21665fd971b12a |
zendit-php-sdk | github_2023 | zenditplatform | php | DtoTransaction.setCurrency | public function setCurrency($currency)
{
if (is_null($currency)) {
throw new \InvalidArgumentException('non-nullable currency cannot be null');
}
$this->container['currency'] = $currency;
return $this;
} | /**
* Sets currency
*
* @param string $currency currency
*
* @return self
*/ | https://github.com/zenditplatform/zendit-php-sdk/blob/b8512157cdbbcec5f99a92154d21665fd971b12a/lib/Model/DtoTransaction.php#L426-L434 | b8512157cdbbcec5f99a92154d21665fd971b12a |
zendit-php-sdk | github_2023 | zenditplatform | php | DtoTransactionsResponse.setIfExists | private function setIfExists(string $variableName, array $fields, $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$... | /**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param arr... | https://github.com/zenditplatform/zendit-php-sdk/blob/b8512157cdbbcec5f99a92154d21665fd971b12a/lib/Model/DtoTransactionsResponse.php#L253-L260 | b8512157cdbbcec5f99a92154d21665fd971b12a |
zendit-php-sdk | github_2023 | zenditplatform | php | DtoTransactionsResponse.__toString | public function __toString()
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
} | /**
* Gets the string presentation of the object
*
* @return string
*/ | https://github.com/zenditplatform/zendit-php-sdk/blob/b8512157cdbbcec5f99a92154d21665fd971b12a/lib/Model/DtoTransactionsResponse.php#L477-L483 | b8512157cdbbcec5f99a92154d21665fd971b12a |
zendit-php-sdk | github_2023 | zenditplatform | php | DtoVoucherField.setIfExists | private function setIfExists(string $variableName, array $fields, $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$... | /**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param arr... | https://github.com/zenditplatform/zendit-php-sdk/blob/b8512157cdbbcec5f99a92154d21665fd971b12a/lib/Model/DtoVoucherField.php#L239-L246 | b8512157cdbbcec5f99a92154d21665fd971b12a |
zendit-php-sdk | github_2023 | zenditplatform | php | DtoZend.openAPIFormats | public static function openAPIFormats()
{
return self::$openAPIFormats;
} | /**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/ | https://github.com/zenditplatform/zendit-php-sdk/blob/b8512157cdbbcec5f99a92154d21665fd971b12a/lib/Model/DtoZend.php#L90-L93 | b8512157cdbbcec5f99a92154d21665fd971b12a |
zendit-php-sdk | github_2023 | zenditplatform | php | DtoZend.setIfExists | private function setIfExists(string $variableName, array $fields, $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$... | /**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param arr... | https://github.com/zenditplatform/zendit-php-sdk/blob/b8512157cdbbcec5f99a92154d21665fd971b12a/lib/Model/DtoZend.php#L260-L267 | b8512157cdbbcec5f99a92154d21665fd971b12a |
oss-arch-gym | github_2023 | srivatsankrishnan | php | GeneratedClassTest.testMessageWithoutNamespace | public function testMessageWithoutNamespace()
{
$m = new TestMessage();
$n = new NoNameSpaceMessage();
$m->setOptionalNoNamespaceMessage($n);
$repeatedNoNamespaceMessage = $m->getRepeatedNoNamespaceMessage();
$repeatedNoNamespaceMessage[] = new NoNameSpaceMessage();
$... | #########################################################
# Test message/enum without namespace.
######################################################### | https://github.com/srivatsankrishnan/oss-arch-gym/blob/fab6d1442541b5cdf40daf24e64e63261da2d846/sims/AstraSim/protobuf-3.12.4/php/tests/generated_class_test.php#L703-L717 | fab6d1442541b5cdf40daf24e64e63261da2d846 |
oss-arch-gym | github_2023 | srivatsankrishnan | php | WrapperTypeSettersTest.testConstructorWithMapWrapperType | public function testConstructorWithMapWrapperType($wrapperField, $getter, $value)
{
$actualInstance = new TestWrapperSetters([$wrapperField => $value]);
foreach ($actualInstance->$getter() as $key => $actualWrapperValue) {
$actualInnerValue = $actualWrapperValue->getValue();
... | /**
* @dataProvider constructorWithMapWrapperTypeDataProvider
*/ | https://github.com/srivatsankrishnan/oss-arch-gym/blob/fab6d1442541b5cdf40daf24e64e63261da2d846/sims/AstraSim/protobuf-3.12.4/php/tests/wrapper_type_setters_test.php#L274-L289 | fab6d1442541b5cdf40daf24e64e63261da2d846 |
inventory | github_2023 | carmonabernaldiego | php | CreateStocksTable.up | public function up()
{
Schema::create('stocks', function (Blueprint $table) {
$table->increments('id');
$table->string('product_code');
$table->integer('product_id');
$table->integer('category_id');
$table->integer('vendor_id');
$table-... | /**
* Run the migrations.
*
* @return void
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/database/migrations/2018_12_10_052521_create_stocks_table.php#L14-L33 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | Xdg.getHomeConfigDir | public function getHomeConfigDir()
{
$path = getenv('XDG_CONFIG_HOME') ?: $this->getHomeDir() . DIRECTORY_SEPARATOR . '.config';
return $path;
} | /**
* @return string
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/dnoegel/php-xdg-base-dir/src/Xdg.php#L31-L36 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | SimpleSerializableAsset.__construct | public function __construct()
{
throw new BadMethodCallException('Not supposed to be called!');
} | /**
* Constructor - should not be called
*
* @throws BadMethodCallException
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleSerializableAsset.php#L37-L40 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | Address.buildingNumber | public static function buildingNumber()
{
return static::numerify(static::randomElement(static::$buildingNumber));
} | /**
* @example '791'
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/fzaninotto/faker/src/Faker/Provider/Address.php#L45-L48 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | Address.country | public static function country()
{
return static::randomElement(static::$country);
} | /**
* @example 'Japan'
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/fzaninotto/faker/src/Faker/Provider/Address.php#L101-L104 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | Payment.bankAccountNumber | public static function bankAccountNumber($prefix = '', $countryCode = 'DE', $length = null)
{
return static::iban($countryCode, $prefix, $length);
} | /**
* International Bank Account Number (IBAN)
* @link http://en.wikipedia.org/wiki/International_Bank_Account_Number
* @param string $prefix for generating bank account number of a specific bank
* @param string $countryCode ISO 3166-1 alpha-2 country code
* @param integer $length ... | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/fzaninotto/faker/src/Faker/Provider/de_DE/Payment.php#L15-L18 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | Address.randomPostcodeLetter | public static function randomPostcodeLetter()
{
return static::randomElement(static::$postcodeLetters);
} | /**
* Returns a postalcode-safe letter
* @example A1B 2C3
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/fzaninotto/faker/src/Faker/Provider/en_CA/Address.php#L47-L50 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | Address.citySuffix | public static function citySuffix()
{
return static::randomElement(static::$citySuffix);
} | /**
* @example '-des-Sables'
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/fzaninotto/faker/src/Faker/Provider/fr_CA/Address.php#L97-L100 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | Person.firstNameMaleChristian | public static function firstNameMaleChristian()
{
return static::randomElement(static::$firstNameMaleChristian);
} | /**
* Return a Christian male name
*
* @example 'Aaron'
*
* @return string
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/fzaninotto/faker/src/Faker/Provider/ms_MY/Person.php#L682-L685 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | AuthManager.resolve | protected function resolve($name)
{
$config = $this->getConfig($name);
if (is_null($config)) {
throw new InvalidArgumentException("Auth guard [{$name}] is not defined.");
}
if (isset($this->customCreators[$config['driver']])) {
return $this->callCustomCreato... | /**
* Resolve the given guard.
*
* @param string $name
* @return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard
*
* @throws \InvalidArgumentException
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php#L79-L98 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | EloquentUserProvider.retrieveByToken | public function retrieveByToken($identifier, $token)
{
$model = $this->createModel();
$model = $model->where($model->getAuthIdentifierName(), $identifier)->first();
if (! $model) {
return null;
}
$rememberToken = $model->getRememberToken();
return $rem... | /**
* Retrieve a user by their unique identifier and "remember me" token.
*
* @param mixed $identifier
* @param string $token
* @return \Illuminate\Contracts\Auth\Authenticatable|null
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php#L61-L74 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | SessionGuard.cycleRememberToken | protected function cycleRememberToken(AuthenticatableContract $user)
{
$user->setRememberToken($token = Str::random(60));
$this->provider->updateRememberToken($user, $token);
} | /**
* Refresh the "remember me" token for the user.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @return void
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php#L529-L534 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | Gate.resolvePolicy | public function resolvePolicy($class)
{
return $this->container->make($class);
} | /**
* Build a policy class instance of the given type.
*
* @param object|string $class
* @return mixed
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php#L436-L439 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | RedisTaggedCache.deleteForeverKeys | protected function deleteForeverKeys()
{
$this->deleteKeysByReference(self::REFERENCE_KEY_FOREVER);
} | /**
* Delete all of the items that were stored forever.
*
* @return void
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Cache/RedisTaggedCache.php#L108-L111 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | Repository.getMinutes | protected function getMinutes($duration)
{
$duration = $this->parseDateInterval($duration);
if ($duration instanceof DateTimeInterface) {
$duration = Carbon::now()->diffInSeconds(Carbon::createFromTimestamp($duration->getTimestamp()), false) / 60;
}
return (int) ($durat... | /**
* Calculate the number of minutes with the given duration.
*
* @param \DateTimeInterface|\DateInterval|float|int $duration
* @return float|int|null
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Cache/Repository.php#L550-L559 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | Command.run | public function run(InputInterface $input, OutputInterface $output)
{
return parent::run(
$this->input = $input, $this->output = new OutputStyle($input, $output)
);
} | /**
* Run the console command.
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return int
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Console/Command.php#L167-L172 | f0fa12c3e312cab38147ff9c204945667f46da75 |
inventory | github_2023 | carmonabernaldiego | php | Connection.insert | public function insert($query, $bindings = [])
{
return $this->statement($query, $bindings);
} | /**
* Run an insert statement against the database.
*
* @param string $query
* @param array $bindings
* @return bool
*/ | https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Database/Connection.php#L409-L412 | f0fa12c3e312cab38147ff9c204945667f46da75 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.