id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
206,500 | laravel/framework | src/Illuminate/Mail/Message.php | Message.sender | public function sender($address, $name = null)
{
$this->swift->setSender($address, $name);
return $this;
} | php | public function sender($address, $name = null)
{
$this->swift->setSender($address, $name);
return $this;
} | [
"public",
"function",
"sender",
"(",
"$",
"address",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"swift",
"->",
"setSender",
"(",
"$",
"address",
",",
"$",
"name",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Set the "sender" of the message.
@param string|array $address
@param string|null $name
@return $this | [
"Set",
"the",
"sender",
"of",
"the",
"message",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/Message.php#L62-L67 |
206,501 | laravel/framework | src/Illuminate/Database/Concerns/ManagesTransactions.php | ManagesTransactions.handleBeginTransactionException | protected function handleBeginTransactionException($e)
{
if ($this->causedByLostConnection($e)) {
$this->reconnect();
$this->pdo->beginTransaction();
} else {
throw $e;
}
} | php | protected function handleBeginTransactionException($e)
{
if ($this->causedByLostConnection($e)) {
$this->reconnect();
$this->pdo->beginTransaction();
} else {
throw $e;
}
} | [
"protected",
"function",
"handleBeginTransactionException",
"(",
"$",
"e",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"causedByLostConnection",
"(",
"$",
"e",
")",
")",
"{",
"$",
"this",
"->",
"reconnect",
"(",
")",
";",
"$",
"this",
"->",
"pdo",
"->",
"b... | Handle an exception from a transaction beginning.
@param \Throwable $e
@return void
@throws \Exception | [
"Handle",
"an",
"exception",
"from",
"a",
"transaction",
"beginning",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Concerns/ManagesTransactions.php#L138-L147 |
206,502 | laravel/framework | src/Illuminate/View/Factory.php | Factory.first | public function first(array $views, $data = [], $mergeData = [])
{
$view = Arr::first($views, function ($view) {
return $this->exists($view);
});
if (! $view) {
throw new InvalidArgumentException('None of the views in the given array exist.');
}
retu... | php | public function first(array $views, $data = [], $mergeData = [])
{
$view = Arr::first($views, function ($view) {
return $this->exists($view);
});
if (! $view) {
throw new InvalidArgumentException('None of the views in the given array exist.');
}
retu... | [
"public",
"function",
"first",
"(",
"array",
"$",
"views",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"mergeData",
"=",
"[",
"]",
")",
"{",
"$",
"view",
"=",
"Arr",
"::",
"first",
"(",
"$",
"views",
",",
"function",
"(",
"$",
"view",
")",
"{",
... | Get the first view that actually exists from the given list.
@param array $views
@param \Illuminate\Contracts\Support\Arrayable|array $data
@param array $mergeData
@return \Illuminate\Contracts\View\View
@throws \InvalidArgumentException | [
"Get",
"the",
"first",
"view",
"that",
"actually",
"exists",
"from",
"the",
"given",
"list",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Factory.php#L153-L164 |
206,503 | laravel/framework | src/Illuminate/View/Factory.php | Factory.renderWhen | public function renderWhen($condition, $view, $data = [], $mergeData = [])
{
if (! $condition) {
return '';
}
return $this->make($view, $this->parseData($data), $mergeData)->render();
} | php | public function renderWhen($condition, $view, $data = [], $mergeData = [])
{
if (! $condition) {
return '';
}
return $this->make($view, $this->parseData($data), $mergeData)->render();
} | [
"public",
"function",
"renderWhen",
"(",
"$",
"condition",
",",
"$",
"view",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"mergeData",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"condition",
")",
"{",
"return",
"''",
";",
"}",
"return",
"$",
"... | Get the rendered content of the view based on a given condition.
@param bool $condition
@param string $view
@param \Illuminate\Contracts\Support\Arrayable|array $data
@param array $mergeData
@return string | [
"Get",
"the",
"rendered",
"content",
"of",
"the",
"view",
"based",
"on",
"a",
"given",
"condition",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Factory.php#L175-L182 |
206,504 | laravel/framework | src/Illuminate/View/Factory.php | Factory.viewInstance | protected function viewInstance($view, $path, $data)
{
return new View($this, $this->getEngineFromPath($path), $view, $path, $data);
} | php | protected function viewInstance($view, $path, $data)
{
return new View($this, $this->getEngineFromPath($path), $view, $path, $data);
} | [
"protected",
"function",
"viewInstance",
"(",
"$",
"view",
",",
"$",
"path",
",",
"$",
"data",
")",
"{",
"return",
"new",
"View",
"(",
"$",
"this",
",",
"$",
"this",
"->",
"getEngineFromPath",
"(",
"$",
"path",
")",
",",
"$",
"view",
",",
"$",
"pat... | Create a new view instance from the given arguments.
@param string $view
@param string $path
@param \Illuminate\Contracts\Support\Arrayable|array $data
@return \Illuminate\Contracts\View\View | [
"Create",
"a",
"new",
"view",
"instance",
"from",
"the",
"given",
"arguments",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/View/Factory.php#L250-L253 |
206,505 | laravel/framework | src/Illuminate/Notifications/SendQueuedNotifications.php | SendQueuedNotifications.handle | public function handle(ChannelManager $manager)
{
$manager->sendNow($this->notifiables, $this->notification, $this->channels);
} | php | public function handle(ChannelManager $manager)
{
$manager->sendNow($this->notifiables, $this->notification, $this->channels);
} | [
"public",
"function",
"handle",
"(",
"ChannelManager",
"$",
"manager",
")",
"{",
"$",
"manager",
"->",
"sendNow",
"(",
"$",
"this",
"->",
"notifiables",
",",
"$",
"this",
"->",
"notification",
",",
"$",
"this",
"->",
"channels",
")",
";",
"}"
] | Send the notifications.
@param \Illuminate\Notifications\ChannelManager $manager
@return void | [
"Send",
"the",
"notifications",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Notifications/SendQueuedNotifications.php#L71-L74 |
206,506 | laravel/framework | src/Illuminate/Queue/Console/ListenCommand.php | ListenCommand.gatherOptions | protected function gatherOptions()
{
return new ListenerOptions(
$this->option('env'), $this->option('delay'),
$this->option('memory'), $this->option('timeout'),
$this->option('sleep'), $this->option('tries'),
$this->option('force')
);
} | php | protected function gatherOptions()
{
return new ListenerOptions(
$this->option('env'), $this->option('delay'),
$this->option('memory'), $this->option('timeout'),
$this->option('sleep'), $this->option('tries'),
$this->option('force')
);
} | [
"protected",
"function",
"gatherOptions",
"(",
")",
"{",
"return",
"new",
"ListenerOptions",
"(",
"$",
"this",
"->",
"option",
"(",
"'env'",
")",
",",
"$",
"this",
"->",
"option",
"(",
"'delay'",
")",
",",
"$",
"this",
"->",
"option",
"(",
"'memory'",
... | Get the listener options for the command.
@return \Illuminate\Queue\ListenerOptions | [
"Get",
"the",
"listener",
"options",
"for",
"the",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Console/ListenCommand.php#L92-L100 |
206,507 | laravel/framework | src/Illuminate/Filesystem/FilesystemAdapter.php | FilesystemAdapter.assertExists | public function assertExists($path)
{
$paths = Arr::wrap($path);
foreach ($paths as $path) {
PHPUnit::assertTrue(
$this->exists($path), "Unable to find a file at path [{$path}]."
);
}
return $this;
} | php | public function assertExists($path)
{
$paths = Arr::wrap($path);
foreach ($paths as $path) {
PHPUnit::assertTrue(
$this->exists($path), "Unable to find a file at path [{$path}]."
);
}
return $this;
} | [
"public",
"function",
"assertExists",
"(",
"$",
"path",
")",
"{",
"$",
"paths",
"=",
"Arr",
"::",
"wrap",
"(",
"$",
"path",
")",
";",
"foreach",
"(",
"$",
"paths",
"as",
"$",
"path",
")",
"{",
"PHPUnit",
"::",
"assertTrue",
"(",
"$",
"this",
"->",
... | Assert that the given file exists.
@param string|array $path
@return $this | [
"Assert",
"that",
"the",
"given",
"file",
"exists",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Filesystem/FilesystemAdapter.php#L57-L68 |
206,508 | laravel/framework | src/Illuminate/Filesystem/FilesystemAdapter.php | FilesystemAdapter.assertMissing | public function assertMissing($path)
{
$paths = Arr::wrap($path);
foreach ($paths as $path) {
PHPUnit::assertFalse(
$this->exists($path), "Found unexpected file at path [{$path}]."
);
}
return $this;
} | php | public function assertMissing($path)
{
$paths = Arr::wrap($path);
foreach ($paths as $path) {
PHPUnit::assertFalse(
$this->exists($path), "Found unexpected file at path [{$path}]."
);
}
return $this;
} | [
"public",
"function",
"assertMissing",
"(",
"$",
"path",
")",
"{",
"$",
"paths",
"=",
"Arr",
"::",
"wrap",
"(",
"$",
"path",
")",
";",
"foreach",
"(",
"$",
"paths",
"as",
"$",
"path",
")",
"{",
"PHPUnit",
"::",
"assertFalse",
"(",
"$",
"this",
"->"... | Assert that the given file does not exist.
@param string|array $path
@return $this | [
"Assert",
"that",
"the",
"given",
"file",
"does",
"not",
"exist",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Filesystem/FilesystemAdapter.php#L76-L87 |
206,509 | laravel/framework | src/Illuminate/Filesystem/FilesystemAdapter.php | FilesystemAdapter.response | public function response($path, $name = null, array $headers = [], $disposition = 'inline')
{
$response = new StreamedResponse;
$disposition = $response->headers->makeDisposition($disposition, $name ?? basename($path));
$response->headers->replace($headers + [
'Content-Type' =>... | php | public function response($path, $name = null, array $headers = [], $disposition = 'inline')
{
$response = new StreamedResponse;
$disposition = $response->headers->makeDisposition($disposition, $name ?? basename($path));
$response->headers->replace($headers + [
'Content-Type' =>... | [
"public",
"function",
"response",
"(",
"$",
"path",
",",
"$",
"name",
"=",
"null",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"$",
"disposition",
"=",
"'inline'",
")",
"{",
"$",
"response",
"=",
"new",
"StreamedResponse",
";",
"$",
"disposition"... | Create a streamed response for a given file.
@param string $path
@param string|null $name
@param array|null $headers
@param string|null $disposition
@return \Symfony\Component\HttpFoundation\StreamedResponse | [
"Create",
"a",
"streamed",
"response",
"for",
"a",
"given",
"file",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Filesystem/FilesystemAdapter.php#L137-L156 |
206,510 | laravel/framework | src/Illuminate/Filesystem/FilesystemAdapter.php | FilesystemAdapter.download | public function download($path, $name = null, array $headers = [])
{
return $this->response($path, $name, $headers, 'attachment');
} | php | public function download($path, $name = null, array $headers = [])
{
return $this->response($path, $name, $headers, 'attachment');
} | [
"public",
"function",
"download",
"(",
"$",
"path",
",",
"$",
"name",
"=",
"null",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"response",
"(",
"$",
"path",
",",
"$",
"name",
",",
"$",
"headers",
",",
"'att... | Create a streamed download response for a given file.
@param string $path
@param string|null $name
@param array|null $headers
@return \Symfony\Component\HttpFoundation\StreamedResponse | [
"Create",
"a",
"streamed",
"download",
"response",
"for",
"a",
"given",
"file",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Filesystem/FilesystemAdapter.php#L166-L169 |
206,511 | laravel/framework | src/Illuminate/Filesystem/FilesystemAdapter.php | FilesystemAdapter.getVisibility | public function getVisibility($path)
{
if ($this->driver->getVisibility($path) == AdapterInterface::VISIBILITY_PUBLIC) {
return FilesystemContract::VISIBILITY_PUBLIC;
}
return FilesystemContract::VISIBILITY_PRIVATE;
} | php | public function getVisibility($path)
{
if ($this->driver->getVisibility($path) == AdapterInterface::VISIBILITY_PUBLIC) {
return FilesystemContract::VISIBILITY_PUBLIC;
}
return FilesystemContract::VISIBILITY_PRIVATE;
} | [
"public",
"function",
"getVisibility",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"driver",
"->",
"getVisibility",
"(",
"$",
"path",
")",
"==",
"AdapterInterface",
"::",
"VISIBILITY_PUBLIC",
")",
"{",
"return",
"FilesystemContract",
"::",
"VIS... | Get the visibility for the given path.
@param string $path
@return string | [
"Get",
"the",
"visibility",
"for",
"the",
"given",
"path",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Filesystem/FilesystemAdapter.php#L244-L251 |
206,512 | laravel/framework | src/Illuminate/Filesystem/FilesystemAdapter.php | FilesystemAdapter.flushCache | public function flushCache()
{
$adapter = $this->driver->getAdapter();
if ($adapter instanceof CachedAdapter) {
$adapter->getCache()->flush();
}
} | php | public function flushCache()
{
$adapter = $this->driver->getAdapter();
if ($adapter instanceof CachedAdapter) {
$adapter->getCache()->flush();
}
} | [
"public",
"function",
"flushCache",
"(",
")",
"{",
"$",
"adapter",
"=",
"$",
"this",
"->",
"driver",
"->",
"getAdapter",
"(",
")",
";",
"if",
"(",
"$",
"adapter",
"instanceof",
"CachedAdapter",
")",
"{",
"$",
"adapter",
"->",
"getCache",
"(",
")",
"->"... | Flush the Flysystem cache.
@return void | [
"Flush",
"the",
"Flysystem",
"cache",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Filesystem/FilesystemAdapter.php#L659-L666 |
206,513 | laravel/framework | src/Illuminate/Translation/FileLoader.php | FileLoader.loadNamespaced | protected function loadNamespaced($locale, $group, $namespace)
{
if (isset($this->hints[$namespace])) {
$lines = $this->loadPath($this->hints[$namespace], $locale, $group);
return $this->loadNamespaceOverrides($lines, $locale, $group, $namespace);
}
return [];
} | php | protected function loadNamespaced($locale, $group, $namespace)
{
if (isset($this->hints[$namespace])) {
$lines = $this->loadPath($this->hints[$namespace], $locale, $group);
return $this->loadNamespaceOverrides($lines, $locale, $group, $namespace);
}
return [];
} | [
"protected",
"function",
"loadNamespaced",
"(",
"$",
"locale",
",",
"$",
"group",
",",
"$",
"namespace",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"hints",
"[",
"$",
"namespace",
"]",
")",
")",
"{",
"$",
"lines",
"=",
"$",
"this",
"->",... | Load a namespaced translation group.
@param string $locale
@param string $group
@param string $namespace
@return array | [
"Load",
"a",
"namespaced",
"translation",
"group",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Translation/FileLoader.php#L81-L90 |
206,514 | laravel/framework | src/Illuminate/Database/Migrations/Migrator.php | Migrator.pendingMigrations | protected function pendingMigrations($files, $ran)
{
return Collection::make($files)
->reject(function ($file) use ($ran) {
return in_array($this->getMigrationName($file), $ran);
})->values()->all();
} | php | protected function pendingMigrations($files, $ran)
{
return Collection::make($files)
->reject(function ($file) use ($ran) {
return in_array($this->getMigrationName($file), $ran);
})->values()->all();
} | [
"protected",
"function",
"pendingMigrations",
"(",
"$",
"files",
",",
"$",
"ran",
")",
"{",
"return",
"Collection",
"::",
"make",
"(",
"$",
"files",
")",
"->",
"reject",
"(",
"function",
"(",
"$",
"file",
")",
"use",
"(",
"$",
"ran",
")",
"{",
"retur... | Get the migration files that have not yet run.
@param array $files
@param array $ran
@return array | [
"Get",
"the",
"migration",
"files",
"that",
"have",
"not",
"yet",
"run",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Migrations/Migrator.php#L123-L129 |
206,515 | laravel/framework | src/Illuminate/Database/Migrations/Migrator.php | Migrator.getSchemaGrammar | protected function getSchemaGrammar($connection)
{
if (is_null($grammar = $connection->getSchemaGrammar())) {
$connection->useDefaultSchemaGrammar();
$grammar = $connection->getSchemaGrammar();
}
return $grammar;
} | php | protected function getSchemaGrammar($connection)
{
if (is_null($grammar = $connection->getSchemaGrammar())) {
$connection->useDefaultSchemaGrammar();
$grammar = $connection->getSchemaGrammar();
}
return $grammar;
} | [
"protected",
"function",
"getSchemaGrammar",
"(",
"$",
"connection",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"grammar",
"=",
"$",
"connection",
"->",
"getSchemaGrammar",
"(",
")",
")",
")",
"{",
"$",
"connection",
"->",
"useDefaultSchemaGrammar",
"(",
")",... | Get the schema grammar out of a migration connection.
@param \Illuminate\Database\Connection $connection
@return \Illuminate\Database\Schema\Grammars\Grammar | [
"Get",
"the",
"schema",
"grammar",
"out",
"of",
"a",
"migration",
"connection",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Migrations/Migrator.php#L555-L564 |
206,516 | laravel/framework | src/Illuminate/Cache/RedisTaggedCache.php | RedisTaggedCache.deleteKeysByReference | protected function deleteKeysByReference($reference)
{
foreach (explode('|', $this->tags->getNamespace()) as $segment) {
$this->deleteValues($segment = $this->referenceKey($segment, $reference));
$this->store->connection()->del($segment);
}
} | php | protected function deleteKeysByReference($reference)
{
foreach (explode('|', $this->tags->getNamespace()) as $segment) {
$this->deleteValues($segment = $this->referenceKey($segment, $reference));
$this->store->connection()->del($segment);
}
} | [
"protected",
"function",
"deleteKeysByReference",
"(",
"$",
"reference",
")",
"{",
"foreach",
"(",
"explode",
"(",
"'|'",
",",
"$",
"this",
"->",
"tags",
"->",
"getNamespace",
"(",
")",
")",
"as",
"$",
"segment",
")",
"{",
"$",
"this",
"->",
"deleteValue... | Find and delete all of the items that were stored against a reference.
@param string $reference
@return void | [
"Find",
"and",
"delete",
"all",
"of",
"the",
"items",
"that",
"were",
"stored",
"against",
"a",
"reference",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/RedisTaggedCache.php#L161-L168 |
206,517 | laravel/framework | src/Illuminate/Broadcasting/BroadcastManager.php | BroadcastManager.routes | public function routes(array $attributes = null)
{
if ($this->app->routesAreCached()) {
return;
}
$attributes = $attributes ?: ['middleware' => ['web']];
$this->app['router']->group($attributes, function ($router) {
$router->match(
['get', 'p... | php | public function routes(array $attributes = null)
{
if ($this->app->routesAreCached()) {
return;
}
$attributes = $attributes ?: ['middleware' => ['web']];
$this->app['router']->group($attributes, function ($router) {
$router->match(
['get', 'p... | [
"public",
"function",
"routes",
"(",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"app",
"->",
"routesAreCached",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"attributes",
"=",
"$",
"attributes",
"?",
":",
"[",
... | Register the routes for handling broadcast authentication and sockets.
@param array|null $attributes
@return void | [
"Register",
"the",
"routes",
"for",
"handling",
"broadcast",
"authentication",
"and",
"sockets",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Broadcasting/BroadcastManager.php#L59-L73 |
206,518 | laravel/framework | src/Illuminate/Http/Concerns/InteractsWithContentTypes.php | InteractsWithContentTypes.matchesType | public static function matchesType($actual, $type)
{
if ($actual === $type) {
return true;
}
$split = explode('/', $actual);
return isset($split[1]) && preg_match('#'.preg_quote($split[0], '#').'/.+\+'.preg_quote($split[1], '#').'#', $type);
} | php | public static function matchesType($actual, $type)
{
if ($actual === $type) {
return true;
}
$split = explode('/', $actual);
return isset($split[1]) && preg_match('#'.preg_quote($split[0], '#').'/.+\+'.preg_quote($split[1], '#').'#', $type);
} | [
"public",
"static",
"function",
"matchesType",
"(",
"$",
"actual",
",",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"actual",
"===",
"$",
"type",
")",
"{",
"return",
"true",
";",
"}",
"$",
"split",
"=",
"explode",
"(",
"'/'",
",",
"$",
"actual",
")",
... | Determine if the given content types match.
@param string $actual
@param string $type
@return bool | [
"Determine",
"if",
"the",
"given",
"content",
"types",
"match",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php#L16-L25 |
206,519 | laravel/framework | src/Illuminate/Http/Concerns/InteractsWithContentTypes.php | InteractsWithContentTypes.accepts | public function accepts($contentTypes)
{
$accepts = $this->getAcceptableContentTypes();
if (count($accepts) === 0) {
return true;
}
$types = (array) $contentTypes;
foreach ($accepts as $accept) {
if ($accept === '*/*' || $accept === '*') {
... | php | public function accepts($contentTypes)
{
$accepts = $this->getAcceptableContentTypes();
if (count($accepts) === 0) {
return true;
}
$types = (array) $contentTypes;
foreach ($accepts as $accept) {
if ($accept === '*/*' || $accept === '*') {
... | [
"public",
"function",
"accepts",
"(",
"$",
"contentTypes",
")",
"{",
"$",
"accepts",
"=",
"$",
"this",
"->",
"getAcceptableContentTypes",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"accepts",
")",
"===",
"0",
")",
"{",
"return",
"true",
";",
"}",
"... | Determines whether the current requests accepts a given content type.
@param string|array $contentTypes
@return bool | [
"Determines",
"whether",
"the",
"current",
"requests",
"accepts",
"a",
"given",
"content",
"type",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php#L65-L88 |
206,520 | laravel/framework | src/Illuminate/Http/Concerns/InteractsWithContentTypes.php | InteractsWithContentTypes.acceptsAnyContentType | public function acceptsAnyContentType()
{
$acceptable = $this->getAcceptableContentTypes();
return count($acceptable) === 0 || (
isset($acceptable[0]) && ($acceptable[0] === '*/*' || $acceptable[0] === '*')
);
} | php | public function acceptsAnyContentType()
{
$acceptable = $this->getAcceptableContentTypes();
return count($acceptable) === 0 || (
isset($acceptable[0]) && ($acceptable[0] === '*/*' || $acceptable[0] === '*')
);
} | [
"public",
"function",
"acceptsAnyContentType",
"(",
")",
"{",
"$",
"acceptable",
"=",
"$",
"this",
"->",
"getAcceptableContentTypes",
"(",
")",
";",
"return",
"count",
"(",
"$",
"acceptable",
")",
"===",
"0",
"||",
"(",
"isset",
"(",
"$",
"acceptable",
"["... | Determine if the current request accepts any content type.
@return bool | [
"Determine",
"if",
"the",
"current",
"request",
"accepts",
"any",
"content",
"type",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php#L126-L133 |
206,521 | laravel/framework | src/Illuminate/Http/Concerns/InteractsWithContentTypes.php | InteractsWithContentTypes.format | public function format($default = 'html')
{
foreach ($this->getAcceptableContentTypes() as $type) {
if ($format = $this->getFormat($type)) {
return $format;
}
}
return $default;
} | php | public function format($default = 'html')
{
foreach ($this->getAcceptableContentTypes() as $type) {
if ($format = $this->getFormat($type)) {
return $format;
}
}
return $default;
} | [
"public",
"function",
"format",
"(",
"$",
"default",
"=",
"'html'",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getAcceptableContentTypes",
"(",
")",
"as",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"format",
"=",
"$",
"this",
"->",
"getFormat",
"(",
"... | Get the data format expected in the response.
@param string $default
@return string | [
"Get",
"the",
"data",
"format",
"expected",
"in",
"the",
"response",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php#L161-L170 |
206,522 | laravel/framework | src/Illuminate/Cache/Console/ClearCommand.php | ClearCommand.flushFacades | public function flushFacades()
{
if (! $this->files->exists($storagePath = storage_path('framework/cache'))) {
return;
}
foreach ($this->files->files($storagePath) as $file) {
if (preg_match('/facade-.*\.php$/', $file)) {
$this->files->delete($file);
... | php | public function flushFacades()
{
if (! $this->files->exists($storagePath = storage_path('framework/cache'))) {
return;
}
foreach ($this->files->files($storagePath) as $file) {
if (preg_match('/facade-.*\.php$/', $file)) {
$this->files->delete($file);
... | [
"public",
"function",
"flushFacades",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"files",
"->",
"exists",
"(",
"$",
"storagePath",
"=",
"storage_path",
"(",
"'framework/cache'",
")",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"this"... | Flush the real-time facades stored in the cache directory.
@return void | [
"Flush",
"the",
"real",
"-",
"time",
"facades",
"stored",
"in",
"the",
"cache",
"directory",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/Console/ClearCommand.php#L87-L98 |
206,523 | laravel/framework | src/Illuminate/Cache/Console/ClearCommand.php | ClearCommand.cache | protected function cache()
{
$cache = $this->cache->store($this->argument('store'));
return empty($this->tags()) ? $cache : $cache->tags($this->tags());
} | php | protected function cache()
{
$cache = $this->cache->store($this->argument('store'));
return empty($this->tags()) ? $cache : $cache->tags($this->tags());
} | [
"protected",
"function",
"cache",
"(",
")",
"{",
"$",
"cache",
"=",
"$",
"this",
"->",
"cache",
"->",
"store",
"(",
"$",
"this",
"->",
"argument",
"(",
"'store'",
")",
")",
";",
"return",
"empty",
"(",
"$",
"this",
"->",
"tags",
"(",
")",
")",
"?... | Get the cache instance for the command.
@return \Illuminate\Cache\Repository | [
"Get",
"the",
"cache",
"instance",
"for",
"the",
"command",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cache/Console/ClearCommand.php#L105-L110 |
206,524 | laravel/framework | src/Illuminate/Queue/SqsQueue.php | SqsQueue.getQueue | public function getQueue($queue)
{
$queue = $queue ?: $this->default;
return filter_var($queue, FILTER_VALIDATE_URL) === false
? rtrim($this->prefix, '/').'/'.$queue : $queue;
} | php | public function getQueue($queue)
{
$queue = $queue ?: $this->default;
return filter_var($queue, FILTER_VALIDATE_URL) === false
? rtrim($this->prefix, '/').'/'.$queue : $queue;
} | [
"public",
"function",
"getQueue",
"(",
"$",
"queue",
")",
"{",
"$",
"queue",
"=",
"$",
"queue",
"?",
":",
"$",
"this",
"->",
"default",
";",
"return",
"filter_var",
"(",
"$",
"queue",
",",
"FILTER_VALIDATE_URL",
")",
"===",
"false",
"?",
"rtrim",
"(",
... | Get the queue or return the default.
@param string|null $queue
@return string | [
"Get",
"the",
"queue",
"or",
"return",
"the",
"default",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/SqsQueue.php#L138-L144 |
206,525 | laravel/framework | src/Illuminate/Support/InteractsWithTime.php | InteractsWithTime.secondsUntil | protected function secondsUntil($delay)
{
$delay = $this->parseDateInterval($delay);
return $delay instanceof DateTimeInterface
? max(0, $delay->getTimestamp() - $this->currentTime())
: (int) $delay;
} | php | protected function secondsUntil($delay)
{
$delay = $this->parseDateInterval($delay);
return $delay instanceof DateTimeInterface
? max(0, $delay->getTimestamp() - $this->currentTime())
: (int) $delay;
} | [
"protected",
"function",
"secondsUntil",
"(",
"$",
"delay",
")",
"{",
"$",
"delay",
"=",
"$",
"this",
"->",
"parseDateInterval",
"(",
"$",
"delay",
")",
";",
"return",
"$",
"delay",
"instanceof",
"DateTimeInterface",
"?",
"max",
"(",
"0",
",",
"$",
"dela... | Get the number of seconds until the given DateTime.
@param \DateTimeInterface|\DateInterval|int $delay
@return int | [
"Get",
"the",
"number",
"of",
"seconds",
"until",
"the",
"given",
"DateTime",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/InteractsWithTime.php#L16-L23 |
206,526 | laravel/framework | src/Illuminate/Support/InteractsWithTime.php | InteractsWithTime.parseDateInterval | protected function parseDateInterval($delay)
{
if ($delay instanceof DateInterval) {
$delay = Carbon::now()->add($delay);
}
return $delay;
} | php | protected function parseDateInterval($delay)
{
if ($delay instanceof DateInterval) {
$delay = Carbon::now()->add($delay);
}
return $delay;
} | [
"protected",
"function",
"parseDateInterval",
"(",
"$",
"delay",
")",
"{",
"if",
"(",
"$",
"delay",
"instanceof",
"DateInterval",
")",
"{",
"$",
"delay",
"=",
"Carbon",
"::",
"now",
"(",
")",
"->",
"add",
"(",
"$",
"delay",
")",
";",
"}",
"return",
"... | If the given value is an interval, convert it to a DateTime instance.
@param \DateTimeInterface|\DateInterval|int $delay
@return \DateTimeInterface|int | [
"If",
"the",
"given",
"value",
"is",
"an",
"interval",
"convert",
"it",
"to",
"a",
"DateTime",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/InteractsWithTime.php#L46-L53 |
206,527 | laravel/framework | src/Illuminate/Database/Connectors/ConnectionFactory.php | ConnectionFactory.createPdoResolver | protected function createPdoResolver(array $config)
{
return array_key_exists('host', $config)
? $this->createPdoResolverWithHosts($config)
: $this->createPdoResolverWithoutHosts($config);
} | php | protected function createPdoResolver(array $config)
{
return array_key_exists('host', $config)
? $this->createPdoResolverWithHosts($config)
: $this->createPdoResolverWithoutHosts($config);
} | [
"protected",
"function",
"createPdoResolver",
"(",
"array",
"$",
"config",
")",
"{",
"return",
"array_key_exists",
"(",
"'host'",
",",
"$",
"config",
")",
"?",
"$",
"this",
"->",
"createPdoResolverWithHosts",
"(",
"$",
"config",
")",
":",
"$",
"this",
"->",
... | Create a new Closure that resolves to a PDO instance.
@param array $config
@return \Closure | [
"Create",
"a",
"new",
"Closure",
"that",
"resolves",
"to",
"a",
"PDO",
"instance",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Connectors/ConnectionFactory.php#L162-L167 |
206,528 | laravel/framework | src/Illuminate/Database/Connectors/ConnectionFactory.php | ConnectionFactory.parseHosts | protected function parseHosts(array $config)
{
$hosts = Arr::wrap($config['host']);
if (empty($hosts)) {
throw new InvalidArgumentException('Database hosts array is empty.');
}
return $hosts;
} | php | protected function parseHosts(array $config)
{
$hosts = Arr::wrap($config['host']);
if (empty($hosts)) {
throw new InvalidArgumentException('Database hosts array is empty.');
}
return $hosts;
} | [
"protected",
"function",
"parseHosts",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"hosts",
"=",
"Arr",
"::",
"wrap",
"(",
"$",
"config",
"[",
"'host'",
"]",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"hosts",
")",
")",
"{",
"throw",
"new",
"InvalidAr... | Parse the hosts configuration item into an array.
@param array $config
@return array | [
"Parse",
"the",
"hosts",
"configuration",
"item",
"into",
"an",
"array",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Connectors/ConnectionFactory.php#L198-L207 |
206,529 | laravel/framework | src/Illuminate/Support/Arr.php | Arr.prepend | public static function prepend($array, $value, $key = null)
{
if (is_null($key)) {
array_unshift($array, $value);
} else {
$array = [$key => $value] + $array;
}
return $array;
} | php | public static function prepend($array, $value, $key = null)
{
if (is_null($key)) {
array_unshift($array, $value);
} else {
$array = [$key => $value] + $array;
}
return $array;
} | [
"public",
"static",
"function",
"prepend",
"(",
"$",
"array",
",",
"$",
"value",
",",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"array_unshift",
"(",
"$",
"array",
",",
"$",
"value",
")",
";",
"}",
... | Push an item onto the beginning of an array.
@param array $array
@param mixed $value
@param mixed $key
@return array | [
"Push",
"an",
"item",
"onto",
"the",
"beginning",
"of",
"an",
"array",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Arr.php#L428-L437 |
206,530 | laravel/framework | src/Illuminate/Mail/PendingMail.php | PendingMail.queue | public function queue(MailableContract $mailable)
{
$mailable = $this->fill($mailable);
if (isset($mailable->delay)) {
return $this->mailer->later($mailable->delay, $mailable);
}
return $this->mailer->queue($mailable);
} | php | public function queue(MailableContract $mailable)
{
$mailable = $this->fill($mailable);
if (isset($mailable->delay)) {
return $this->mailer->later($mailable->delay, $mailable);
}
return $this->mailer->queue($mailable);
} | [
"public",
"function",
"queue",
"(",
"MailableContract",
"$",
"mailable",
")",
"{",
"$",
"mailable",
"=",
"$",
"this",
"->",
"fill",
"(",
"$",
"mailable",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"mailable",
"->",
"delay",
")",
")",
"{",
"return",
"$",... | Push the given mailable onto the queue.
@param \Illuminate\Contracts\Mail\Mailable $mailable;
@return mixed | [
"Push",
"the",
"given",
"mailable",
"onto",
"the",
"queue",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Mail/PendingMail.php#L147-L156 |
206,531 | laravel/framework | src/Illuminate/Cookie/CookieJar.php | CookieJar.forget | public function forget($name, $path = null, $domain = null)
{
return $this->make($name, null, -2628000, $path, $domain);
} | php | public function forget($name, $path = null, $domain = null)
{
return $this->make($name, null, -2628000, $path, $domain);
} | [
"public",
"function",
"forget",
"(",
"$",
"name",
",",
"$",
"path",
"=",
"null",
",",
"$",
"domain",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"make",
"(",
"$",
"name",
",",
"null",
",",
"-",
"2628000",
",",
"$",
"path",
",",
"$",
"do... | Expire the given cookie.
@param string $name
@param string $path
@param string $domain
@return \Symfony\Component\HttpFoundation\Cookie | [
"Expire",
"the",
"given",
"cookie",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Cookie/CookieJar.php#L99-L102 |
206,532 | laravel/framework | src/Illuminate/Pagination/Paginator.php | Paginator.setItems | protected function setItems($items)
{
$this->items = $items instanceof Collection ? $items : Collection::make($items);
$this->hasMore = $this->items->count() > $this->perPage;
$this->items = $this->items->slice(0, $this->perPage);
} | php | protected function setItems($items)
{
$this->items = $items instanceof Collection ? $items : Collection::make($items);
$this->hasMore = $this->items->count() > $this->perPage;
$this->items = $this->items->slice(0, $this->perPage);
} | [
"protected",
"function",
"setItems",
"(",
"$",
"items",
")",
"{",
"$",
"this",
"->",
"items",
"=",
"$",
"items",
"instanceof",
"Collection",
"?",
"$",
"items",
":",
"Collection",
"::",
"make",
"(",
"$",
"items",
")",
";",
"$",
"this",
"->",
"hasMore",
... | Set the items for the paginator.
@param mixed $items
@return void | [
"Set",
"the",
"items",
"for",
"the",
"paginator",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Pagination/Paginator.php#L67-L74 |
206,533 | laravel/framework | src/Illuminate/Console/Scheduling/CacheSchedulingMutex.php | CacheSchedulingMutex.create | public function create(Event $event, DateTimeInterface $time)
{
return $this->cache->store($this->store)->add(
$event->mutexName().$time->format('Hi'), true, 3600
);
} | php | public function create(Event $event, DateTimeInterface $time)
{
return $this->cache->store($this->store)->add(
$event->mutexName().$time->format('Hi'), true, 3600
);
} | [
"public",
"function",
"create",
"(",
"Event",
"$",
"event",
",",
"DateTimeInterface",
"$",
"time",
")",
"{",
"return",
"$",
"this",
"->",
"cache",
"->",
"store",
"(",
"$",
"this",
"->",
"store",
")",
"->",
"add",
"(",
"$",
"event",
"->",
"mutexName",
... | Attempt to obtain a scheduling mutex for the given event.
@param \Illuminate\Console\Scheduling\Event $event
@param \DateTimeInterface $time
@return bool | [
"Attempt",
"to",
"obtain",
"a",
"scheduling",
"mutex",
"for",
"the",
"given",
"event",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/CacheSchedulingMutex.php#L42-L47 |
206,534 | laravel/framework | src/Illuminate/Console/Scheduling/CacheSchedulingMutex.php | CacheSchedulingMutex.exists | public function exists(Event $event, DateTimeInterface $time)
{
return $this->cache->store($this->store)->has(
$event->mutexName().$time->format('Hi')
);
} | php | public function exists(Event $event, DateTimeInterface $time)
{
return $this->cache->store($this->store)->has(
$event->mutexName().$time->format('Hi')
);
} | [
"public",
"function",
"exists",
"(",
"Event",
"$",
"event",
",",
"DateTimeInterface",
"$",
"time",
")",
"{",
"return",
"$",
"this",
"->",
"cache",
"->",
"store",
"(",
"$",
"this",
"->",
"store",
")",
"->",
"has",
"(",
"$",
"event",
"->",
"mutexName",
... | Determine if a scheduling mutex exists for the given event.
@param \Illuminate\Console\Scheduling\Event $event
@param \DateTimeInterface $time
@return bool | [
"Determine",
"if",
"a",
"scheduling",
"mutex",
"exists",
"for",
"the",
"given",
"event",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Console/Scheduling/CacheSchedulingMutex.php#L56-L61 |
206,535 | laravel/framework | src/Illuminate/Queue/Jobs/BeanstalkdJob.php | BeanstalkdJob.attempts | public function attempts()
{
$stats = $this->pheanstalk->statsJob($this->job);
return (int) $stats->reserves;
} | php | public function attempts()
{
$stats = $this->pheanstalk->statsJob($this->job);
return (int) $stats->reserves;
} | [
"public",
"function",
"attempts",
"(",
")",
"{",
"$",
"stats",
"=",
"$",
"this",
"->",
"pheanstalk",
"->",
"statsJob",
"(",
"$",
"this",
"->",
"job",
")",
";",
"return",
"(",
"int",
")",
"$",
"stats",
"->",
"reserves",
";",
"}"
] | Get the number of times the job has been attempted.
@return int | [
"Get",
"the",
"number",
"of",
"times",
"the",
"job",
"has",
"been",
"attempted",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Queue/Jobs/BeanstalkdJob.php#L89-L94 |
206,536 | laravel/framework | src/Illuminate/Database/Query/JoinClause.php | JoinClause.orOn | public function orOn($first, $operator = null, $second = null)
{
return $this->on($first, $operator, $second, 'or');
} | php | public function orOn($first, $operator = null, $second = null)
{
return $this->on($first, $operator, $second, 'or');
} | [
"public",
"function",
"orOn",
"(",
"$",
"first",
",",
"$",
"operator",
"=",
"null",
",",
"$",
"second",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"on",
"(",
"$",
"first",
",",
"$",
"operator",
",",
"$",
"second",
",",
"'or'",
")",
";",
... | Add an "or on" clause to the join.
@param \Closure|string $first
@param string|null $operator
@param string|null $second
@return \Illuminate\Database\Query\JoinClause | [
"Add",
"an",
"or",
"on",
"clause",
"to",
"the",
"join",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Database/Query/JoinClause.php#L110-L113 |
206,537 | laravel/framework | src/Illuminate/Support/Optional.php | Optional.__isset | public function __isset($name)
{
if (is_object($this->value)) {
return isset($this->value->{$name});
}
if (is_array($this->value) || $this->value instanceof ArrayObject) {
return isset($this->value[$name]);
}
return false;
} | php | public function __isset($name)
{
if (is_object($this->value)) {
return isset($this->value->{$name});
}
if (is_array($this->value) || $this->value instanceof ArrayObject) {
return isset($this->value[$name]);
}
return false;
} | [
"public",
"function",
"__isset",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"this",
"->",
"value",
")",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"value",
"->",
"{",
"$",
"name",
"}",
")",
";",
"}",
"if",
"(",
"is_... | Dynamically check a property exists on the underlying object.
@param mixed $name
@return bool | [
"Dynamically",
"check",
"a",
"property",
"exists",
"on",
"the",
"underlying",
"object",
"."
] | 0e0a428a50fc8378e3f77d18f3caae76c19e8c7a | https://github.com/laravel/framework/blob/0e0a428a50fc8378e3f77d18f3caae76c19e8c7a/src/Illuminate/Support/Optional.php#L51-L62 |
206,538 | ccxt/ccxt | php/Exchange.php | Exchange.safe_float_2 | public static function safe_float_2 ($object, $key1, $key2, $default_value = null) {
$value = static::safe_float ($object, $key1);
return isset ($value) ? $value : static::safe_float ($object, $key2, $default_value);
} | php | public static function safe_float_2 ($object, $key1, $key2, $default_value = null) {
$value = static::safe_float ($object, $key1);
return isset ($value) ? $value : static::safe_float ($object, $key2, $default_value);
} | [
"public",
"static",
"function",
"safe_float_2",
"(",
"$",
"object",
",",
"$",
"key1",
",",
"$",
"key2",
",",
"$",
"default_value",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"static",
"::",
"safe_float",
"(",
"$",
"object",
",",
"$",
"key1",
")",
";",... | we're not using safe_float_3 either because those cases are too rare to deserve their own optimization | [
"we",
"re",
"not",
"using",
"safe_float_3",
"either",
"because",
"those",
"cases",
"are",
"too",
"rare",
"to",
"deserve",
"their",
"own",
"optimization"
] | 0113da333a51acded0b44d9528809bbf654acfbd | https://github.com/ccxt/ccxt/blob/0113da333a51acded0b44d9528809bbf654acfbd/php/Exchange.php#L247-L250 |
206,539 | ccxt/ccxt | php/Exchange.php | Exchange.throttle | public function throttle () {
$now = $this->milliseconds ();
$elapsed = $now - $this->lastRestRequestTimestamp;
if ($elapsed < $this->rateLimit) {
$delay = $this->rateLimit - $elapsed;
usleep ((int)($delay * 1000.0));
}
} | php | public function throttle () {
$now = $this->milliseconds ();
$elapsed = $now - $this->lastRestRequestTimestamp;
if ($elapsed < $this->rateLimit) {
$delay = $this->rateLimit - $elapsed;
usleep ((int)($delay * 1000.0));
}
} | [
"public",
"function",
"throttle",
"(",
")",
"{",
"$",
"now",
"=",
"$",
"this",
"->",
"milliseconds",
"(",
")",
";",
"$",
"elapsed",
"=",
"$",
"now",
"-",
"$",
"this",
"->",
"lastRestRequestTimestamp",
";",
"if",
"(",
"$",
"elapsed",
"<",
"$",
"this",... | this method is experimental | [
"this",
"method",
"is",
"experimental"
] | 0113da333a51acded0b44d9528809bbf654acfbd | https://github.com/ccxt/ccxt/blob/0113da333a51acded0b44d9528809bbf654acfbd/php/Exchange.php#L1019-L1026 |
206,540 | symfony/symfony | src/Symfony/Component/Process/InputStream.php | InputStream.write | public function write($input)
{
if (null === $input) {
return;
}
if ($this->isClosed()) {
throw new RuntimeException(sprintf('%s is closed', static::class));
}
$this->input[] = ProcessUtils::validateInput(__METHOD__, $input);
} | php | public function write($input)
{
if (null === $input) {
return;
}
if ($this->isClosed()) {
throw new RuntimeException(sprintf('%s is closed', static::class));
}
$this->input[] = ProcessUtils::validateInput(__METHOD__, $input);
} | [
"public",
"function",
"write",
"(",
"$",
"input",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"input",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"isClosed",
"(",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"sprintf",
"(",... | Appends an input to the write buffer.
@param resource|string|int|float|bool|\Traversable|null $input The input to append as scalar,
stream resource or \Traversable | [
"Appends",
"an",
"input",
"to",
"the",
"write",
"buffer",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Process/InputStream.php#L42-L51 |
206,541 | symfony/symfony | src/Symfony/Component/HttpKernel/EventListener/AddRequestFormatsListener.php | AddRequestFormatsListener.onKernelRequest | public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
foreach ($this->formats as $format => $mimeTypes) {
$request->setFormat($format, $mimeTypes);
}
} | php | public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
foreach ($this->formats as $format => $mimeTypes) {
$request->setFormat($format, $mimeTypes);
}
} | [
"public",
"function",
"onKernelRequest",
"(",
"GetResponseEvent",
"$",
"event",
")",
"{",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"formats",
"as",
"$",
"format",
"=>",
"$",
"mimeTypes",
")"... | Adds request formats. | [
"Adds",
"request",
"formats",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/EventListener/AddRequestFormatsListener.php#L37-L43 |
206,542 | symfony/symfony | src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php | ReflectionExtractor.extractFromConstructor | private function extractFromConstructor(string $class, string $property): ?array
{
try {
$reflectionClass = new \ReflectionClass($class);
} catch (\ReflectionException $e) {
return null;
}
$constructor = $reflectionClass->getConstructor();
if (!$cons... | php | private function extractFromConstructor(string $class, string $property): ?array
{
try {
$reflectionClass = new \ReflectionClass($class);
} catch (\ReflectionException $e) {
return null;
}
$constructor = $reflectionClass->getConstructor();
if (!$cons... | [
"private",
"function",
"extractFromConstructor",
"(",
"string",
"$",
"class",
",",
"string",
"$",
"property",
")",
":",
"?",
"array",
"{",
"try",
"{",
"$",
"reflectionClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"}",
"catch",
... | Tries to extract type information from constructor.
@return Type[]|null | [
"Tries",
"to",
"extract",
"type",
"information",
"from",
"constructor",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php#L265-L293 |
206,543 | symfony/symfony | src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php | ReflectionExtractor.getAccessorMethod | private function getAccessorMethod(string $class, string $property): ?array
{
$ucProperty = ucfirst($property);
foreach ($this->accessorPrefixes as $prefix) {
try {
$reflectionMethod = new \ReflectionMethod($class, $prefix.$ucProperty);
if ($reflectionMet... | php | private function getAccessorMethod(string $class, string $property): ?array
{
$ucProperty = ucfirst($property);
foreach ($this->accessorPrefixes as $prefix) {
try {
$reflectionMethod = new \ReflectionMethod($class, $prefix.$ucProperty);
if ($reflectionMet... | [
"private",
"function",
"getAccessorMethod",
"(",
"string",
"$",
"class",
",",
"string",
"$",
"property",
")",
":",
"?",
"array",
"{",
"$",
"ucProperty",
"=",
"ucfirst",
"(",
"$",
"property",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"accessorPrefixes",
... | Gets the accessor method.
Returns an array with a the instance of \ReflectionMethod as first key
and the prefix of the method as second or null if not found. | [
"Gets",
"the",
"accessor",
"method",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php#L375-L395 |
206,544 | symfony/symfony | src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php | ReflectionExtractor.getMutatorMethod | private function getMutatorMethod(string $class, string $property): ?array
{
$ucProperty = ucfirst($property);
$ucSingulars = (array) Inflector::singularize($ucProperty);
foreach ($this->mutatorPrefixes as $prefix) {
$names = [$ucProperty];
if (\in_array($prefix, $th... | php | private function getMutatorMethod(string $class, string $property): ?array
{
$ucProperty = ucfirst($property);
$ucSingulars = (array) Inflector::singularize($ucProperty);
foreach ($this->mutatorPrefixes as $prefix) {
$names = [$ucProperty];
if (\in_array($prefix, $th... | [
"private",
"function",
"getMutatorMethod",
"(",
"string",
"$",
"class",
",",
"string",
"$",
"property",
")",
":",
"?",
"array",
"{",
"$",
"ucProperty",
"=",
"ucfirst",
"(",
"$",
"property",
")",
";",
"$",
"ucSingulars",
"=",
"(",
"array",
")",
"Inflector... | Returns an array with a the instance of \ReflectionMethod as first key
and the prefix of the method as second or null if not found. | [
"Returns",
"an",
"array",
"with",
"a",
"the",
"instance",
"of",
"\\",
"ReflectionMethod",
"as",
"first",
"key",
"and",
"the",
"prefix",
"of",
"the",
"method",
"as",
"second",
"or",
"null",
"if",
"not",
"found",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php#L401-L430 |
206,545 | symfony/symfony | src/Symfony/Bundle/SecurityBundle/EventListener/VoteListener.php | VoteListener.onVoterVote | public function onVoterVote(VoteEvent $event)
{
$this->traceableAccessDecisionManager->addVoterVote($event->getVoter(), $event->getAttributes(), $event->getVote());
} | php | public function onVoterVote(VoteEvent $event)
{
$this->traceableAccessDecisionManager->addVoterVote($event->getVoter(), $event->getAttributes(), $event->getVote());
} | [
"public",
"function",
"onVoterVote",
"(",
"VoteEvent",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"traceableAccessDecisionManager",
"->",
"addVoterVote",
"(",
"$",
"event",
"->",
"getVoter",
"(",
")",
",",
"$",
"event",
"->",
"getAttributes",
"(",
")",
",",
... | Event dispatched by a voter during access manager decision.
@param VoteEvent $event event with voter data | [
"Event",
"dispatched",
"by",
"a",
"voter",
"during",
"access",
"manager",
"decision",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/SecurityBundle/EventListener/VoteListener.php#L39-L42 |
206,546 | symfony/symfony | src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php | DeprecationErrorHandler.register | public static function register($mode = 0)
{
if (self::$isRegistered) {
return;
}
self::$utilPrefix = class_exists('PHPUnit_Util_ErrorHandler') ? 'PHPUnit_Util_' : 'PHPUnit\Util\\';
$handler = new self();
$oldErrorHandler = set_error_handler([$handler, 'handleEr... | php | public static function register($mode = 0)
{
if (self::$isRegistered) {
return;
}
self::$utilPrefix = class_exists('PHPUnit_Util_ErrorHandler') ? 'PHPUnit_Util_' : 'PHPUnit\Util\\';
$handler = new self();
$oldErrorHandler = set_error_handler([$handler, 'handleEr... | [
"public",
"static",
"function",
"register",
"(",
"$",
"mode",
"=",
"0",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"isRegistered",
")",
"{",
"return",
";",
"}",
"self",
"::",
"$",
"utilPrefix",
"=",
"class_exists",
"(",
"'PHPUnit_Util_ErrorHandler'",
")",
"... | Registers and configures the deprecation handler.
The mode is a query string with options:
- "disabled" to disable the deprecation handler
- "verbose" to enable/disable displaying the deprecation report
- "max" to configure the number of deprecations to allow before exiting with a non-zero
status code; it's an array w... | [
"Registers",
"and",
"configures",
"the",
"deprecation",
"handler",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php#L69-L92 |
206,547 | symfony/symfony | src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php | DeprecationErrorHandler.hasColorSupport | private static function hasColorSupport()
{
if (!\defined('STDOUT')) {
return false;
}
if ('Hyper' === getenv('TERM_PROGRAM')) {
return true;
}
if (\DIRECTORY_SEPARATOR === '\\') {
return (\function_exists('sapi_windows_vt100_support')
... | php | private static function hasColorSupport()
{
if (!\defined('STDOUT')) {
return false;
}
if ('Hyper' === getenv('TERM_PROGRAM')) {
return true;
}
if (\DIRECTORY_SEPARATOR === '\\') {
return (\function_exists('sapi_windows_vt100_support')
... | [
"private",
"static",
"function",
"hasColorSupport",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"defined",
"(",
"'STDOUT'",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"'Hyper'",
"===",
"getenv",
"(",
"'TERM_PROGRAM'",
")",
")",
"{",
"return",
"tru... | Returns true if STDOUT is defined and supports colorization.
Reference: Composer\XdebugHandler\Process::supportsColor
https://github.com/composer/xdebug-handler
@return bool | [
"Returns",
"true",
"if",
"STDOUT",
"is",
"defined",
"and",
"supports",
"colorization",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php#L318-L348 |
206,548 | symfony/symfony | src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php | ResponseHeaderBag.removeCookie | public function removeCookie($name, $path = '/', $domain = null)
{
if (null === $path) {
$path = '/';
}
unset($this->cookies[$domain][$path][$name]);
if (empty($this->cookies[$domain][$path])) {
unset($this->cookies[$domain][$path]);
if (empty($... | php | public function removeCookie($name, $path = '/', $domain = null)
{
if (null === $path) {
$path = '/';
}
unset($this->cookies[$domain][$path][$name]);
if (empty($this->cookies[$domain][$path])) {
unset($this->cookies[$domain][$path]);
if (empty($... | [
"public",
"function",
"removeCookie",
"(",
"$",
"name",
",",
"$",
"path",
"=",
"'/'",
",",
"$",
"domain",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"'/'",
";",
"}",
"unset",
"(",
"$",
"this",
"->"... | Removes a cookie from the array, but does not unset it in the browser.
@param string $name
@param string $path
@param string $domain | [
"Removes",
"a",
"cookie",
"from",
"the",
"array",
"but",
"does",
"not",
"unset",
"it",
"in",
"the",
"browser",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php#L186-L205 |
206,549 | symfony/symfony | src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php | ResponseHeaderBag.getCookies | public function getCookies($format = self::COOKIES_FLAT)
{
if (!\in_array($format, [self::COOKIES_FLAT, self::COOKIES_ARRAY])) {
throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', [self::COOKIES_FLAT, self::COOKIES_ARRAY])));
}
if (se... | php | public function getCookies($format = self::COOKIES_FLAT)
{
if (!\in_array($format, [self::COOKIES_FLAT, self::COOKIES_ARRAY])) {
throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', [self::COOKIES_FLAT, self::COOKIES_ARRAY])));
}
if (se... | [
"public",
"function",
"getCookies",
"(",
"$",
"format",
"=",
"self",
"::",
"COOKIES_FLAT",
")",
"{",
"if",
"(",
"!",
"\\",
"in_array",
"(",
"$",
"format",
",",
"[",
"self",
"::",
"COOKIES_FLAT",
",",
"self",
"::",
"COOKIES_ARRAY",
"]",
")",
")",
"{",
... | Returns an array with all cookies.
@param string $format
@return Cookie[]
@throws \InvalidArgumentException When the $format is invalid | [
"Returns",
"an",
"array",
"with",
"all",
"cookies",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php#L216-L236 |
206,550 | symfony/symfony | src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php | ResponseHeaderBag.computeCacheControlValue | protected function computeCacheControlValue()
{
if (!$this->cacheControl && !$this->has('ETag') && !$this->has('Last-Modified') && !$this->has('Expires')) {
return 'no-cache, private';
}
if (!$this->cacheControl) {
// conservative by default
return 'priva... | php | protected function computeCacheControlValue()
{
if (!$this->cacheControl && !$this->has('ETag') && !$this->has('Last-Modified') && !$this->has('Expires')) {
return 'no-cache, private';
}
if (!$this->cacheControl) {
// conservative by default
return 'priva... | [
"protected",
"function",
"computeCacheControlValue",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"cacheControl",
"&&",
"!",
"$",
"this",
"->",
"has",
"(",
"'ETag'",
")",
"&&",
"!",
"$",
"this",
"->",
"has",
"(",
"'Last-Modified'",
")",
"&&",
"!",... | Returns the calculated value of the cache-control header.
This considers several other headers and calculates or modifies the
cache-control header to a sensible, conservative value.
@return string | [
"Returns",
"the",
"calculated",
"value",
"of",
"the",
"cache",
"-",
"control",
"header",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php#L268-L290 |
206,551 | symfony/symfony | src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php | MoneyType.getPattern | protected static function getPattern($currency)
{
if (!$currency) {
return '{{ widget }}';
}
$locale = \Locale::getDefault();
if (!isset(self::$patterns[$locale])) {
self::$patterns[$locale] = [];
}
if (!isset(self::$patterns[$locale][$curre... | php | protected static function getPattern($currency)
{
if (!$currency) {
return '{{ widget }}';
}
$locale = \Locale::getDefault();
if (!isset(self::$patterns[$locale])) {
self::$patterns[$locale] = [];
}
if (!isset(self::$patterns[$locale][$curre... | [
"protected",
"static",
"function",
"getPattern",
"(",
"$",
"currency",
")",
"{",
"if",
"(",
"!",
"$",
"currency",
")",
"{",
"return",
"'{{ widget }}'",
";",
"}",
"$",
"locale",
"=",
"\\",
"Locale",
"::",
"getDefault",
"(",
")",
";",
"if",
"(",
"!",
"... | Returns the pattern for this locale in UTF-8.
The pattern contains the placeholder "{{ widget }}" where the HTML tag should
be inserted | [
"Returns",
"the",
"pattern",
"for",
"this",
"locale",
"in",
"UTF",
"-",
"8",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php#L90-L124 |
206,552 | symfony/symfony | src/Symfony/Component/Routing/RouteCompiler.php | RouteCompiler.computeRegexp | private static function computeRegexp(array $tokens, int $index, int $firstOptional): string
{
$token = $tokens[$index];
if ('text' === $token[0]) {
// Text tokens
return preg_quote($token[1], self::REGEX_DELIMITER);
} else {
// Variable tokens
... | php | private static function computeRegexp(array $tokens, int $index, int $firstOptional): string
{
$token = $tokens[$index];
if ('text' === $token[0]) {
// Text tokens
return preg_quote($token[1], self::REGEX_DELIMITER);
} else {
// Variable tokens
... | [
"private",
"static",
"function",
"computeRegexp",
"(",
"array",
"$",
"tokens",
",",
"int",
"$",
"index",
",",
"int",
"$",
"firstOptional",
")",
":",
"string",
"{",
"$",
"token",
"=",
"$",
"tokens",
"[",
"$",
"index",
"]",
";",
"if",
"(",
"'text'",
"=... | Computes the regexp used to match a specific token. It can be static text or a subpattern.
@param array $tokens The route tokens
@param int $index The index of the current token
@param int $firstOptional The index of the first optional token
@return string The regexp pattern for a single token | [
"Computes",
"the",
"regexp",
"used",
"to",
"match",
"a",
"specific",
"token",
".",
"It",
"can",
"be",
"static",
"text",
"or",
"a",
"subpattern",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Routing/RouteCompiler.php#L287-L315 |
206,553 | symfony/symfony | src/Symfony/Component/VarExporter/Instantiator.php | Instantiator.instantiate | public static function instantiate(string $class, array $properties = [], array $privateProperties = [])
{
$reflector = Registry::$reflectors[$class] ?? Registry::getClassReflector($class);
if (Registry::$cloneable[$class]) {
$wrappedInstance = [clone Registry::$prototypes[$class]];
... | php | public static function instantiate(string $class, array $properties = [], array $privateProperties = [])
{
$reflector = Registry::$reflectors[$class] ?? Registry::getClassReflector($class);
if (Registry::$cloneable[$class]) {
$wrappedInstance = [clone Registry::$prototypes[$class]];
... | [
"public",
"static",
"function",
"instantiate",
"(",
"string",
"$",
"class",
",",
"array",
"$",
"properties",
"=",
"[",
"]",
",",
"array",
"$",
"privateProperties",
"=",
"[",
"]",
")",
"{",
"$",
"reflector",
"=",
"Registry",
"::",
"$",
"reflectors",
"[",
... | Creates an object and sets its properties without calling its constructor nor any other methods.
For example:
// creates an empty instance of Foo
Instantiator::instantiate(Foo::class);
// creates a Foo instance and sets one of its properties
Instantiator::instantiate(Foo::class, ['propertyName' => $propertyValue]);
... | [
"Creates",
"an",
"object",
"and",
"sets",
"its",
"properties",
"without",
"calling",
"its",
"constructor",
"nor",
"any",
"other",
"methods",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarExporter/Instantiator.php#L60-L93 |
206,554 | symfony/symfony | src/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php | Tokenizer.tokenize | public function tokenize(Reader $reader)
{
$stream = new TokenStream();
while (!$reader->isEOF()) {
foreach ($this->handlers as $handler) {
if ($handler->handle($reader, $stream)) {
continue 2;
}
}
$stream->pus... | php | public function tokenize(Reader $reader)
{
$stream = new TokenStream();
while (!$reader->isEOF()) {
foreach ($this->handlers as $handler) {
if ($handler->handle($reader, $stream)) {
continue 2;
}
}
$stream->pus... | [
"public",
"function",
"tokenize",
"(",
"Reader",
"$",
"reader",
")",
"{",
"$",
"stream",
"=",
"new",
"TokenStream",
"(",
")",
";",
"while",
"(",
"!",
"$",
"reader",
"->",
"isEOF",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"handlers",
"... | Tokenize selector source code.
@return TokenStream | [
"Tokenize",
"selector",
"source",
"code",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php#L56-L74 |
206,555 | symfony/symfony | src/Symfony/Component/Console/Helper/ProgressBar.php | ProgressBar.getPlaceholderFormatterDefinition | public static function getPlaceholderFormatterDefinition(string $name): ?callable
{
if (!self::$formatters) {
self::$formatters = self::initPlaceholderFormatters();
}
return isset(self::$formatters[$name]) ? self::$formatters[$name] : null;
} | php | public static function getPlaceholderFormatterDefinition(string $name): ?callable
{
if (!self::$formatters) {
self::$formatters = self::initPlaceholderFormatters();
}
return isset(self::$formatters[$name]) ? self::$formatters[$name] : null;
} | [
"public",
"static",
"function",
"getPlaceholderFormatterDefinition",
"(",
"string",
"$",
"name",
")",
":",
"?",
"callable",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"formatters",
")",
"{",
"self",
"::",
"$",
"formatters",
"=",
"self",
"::",
"initPlaceholderFo... | Gets the placeholder formatter for a given name.
@param string $name The placeholder name (including the delimiter char like %)
@return callable|null A PHP callable | [
"Gets",
"the",
"placeholder",
"formatter",
"for",
"a",
"given",
"name",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/ProgressBar.php#L99-L106 |
206,556 | symfony/symfony | src/Symfony/Component/Console/Helper/ProgressBar.php | ProgressBar.getFormatDefinition | public static function getFormatDefinition(string $name): ?string
{
if (!self::$formats) {
self::$formats = self::initFormats();
}
return isset(self::$formats[$name]) ? self::$formats[$name] : null;
} | php | public static function getFormatDefinition(string $name): ?string
{
if (!self::$formats) {
self::$formats = self::initFormats();
}
return isset(self::$formats[$name]) ? self::$formats[$name] : null;
} | [
"public",
"static",
"function",
"getFormatDefinition",
"(",
"string",
"$",
"name",
")",
":",
"?",
"string",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"formats",
")",
"{",
"self",
"::",
"$",
"formats",
"=",
"self",
"::",
"initFormats",
"(",
")",
";",
"}... | Gets the format for a given name.
@param string $name The format name
@return string|null A format string | [
"Gets",
"the",
"format",
"for",
"a",
"given",
"name",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/ProgressBar.php#L132-L139 |
206,557 | symfony/symfony | src/Symfony/Component/Console/Helper/ProgressBar.php | ProgressBar.iterate | public function iterate(iterable $iterable, ?int $max = null): iterable
{
$this->start($max ?? (\is_countable($iterable) ? \count($iterable) : 0));
foreach ($iterable as $key => $value) {
yield $key => $value;
$this->advance();
}
$this->finish();
} | php | public function iterate(iterable $iterable, ?int $max = null): iterable
{
$this->start($max ?? (\is_countable($iterable) ? \count($iterable) : 0));
foreach ($iterable as $key => $value) {
yield $key => $value;
$this->advance();
}
$this->finish();
} | [
"public",
"function",
"iterate",
"(",
"iterable",
"$",
"iterable",
",",
"?",
"int",
"$",
"max",
"=",
"null",
")",
":",
"iterable",
"{",
"$",
"this",
"->",
"start",
"(",
"$",
"max",
"??",
"(",
"\\",
"is_countable",
"(",
"$",
"iterable",
")",
"?",
"\... | Returns an iterator that will automatically update the progress bar when iterated.
@param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable | [
"Returns",
"an",
"iterator",
"that",
"will",
"automatically",
"update",
"the",
"progress",
"bar",
"when",
"iterated",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/ProgressBar.php#L251-L262 |
206,558 | symfony/symfony | src/Symfony/Component/Console/Helper/ProgressBar.php | ProgressBar.clear | public function clear(): void
{
if (!$this->overwrite) {
return;
}
if (null === $this->format) {
$this->setRealFormat($this->internalFormat ?: $this->determineBestFormat());
}
$this->overwrite('');
} | php | public function clear(): void
{
if (!$this->overwrite) {
return;
}
if (null === $this->format) {
$this->setRealFormat($this->internalFormat ?: $this->determineBestFormat());
}
$this->overwrite('');
} | [
"public",
"function",
"clear",
"(",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"overwrite",
")",
"{",
"return",
";",
"}",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"format",
")",
"{",
"$",
"this",
"->",
"setRealFormat",
"(",
"$"... | Removes the progress bar from the current line.
This is useful if you wish to write some output
while a progress bar is running.
Call display() to show the progress bar again. | [
"Removes",
"the",
"progress",
"bar",
"from",
"the",
"current",
"line",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/ProgressBar.php#L364-L375 |
206,559 | symfony/symfony | src/Symfony/Component/Security/Core/User/LdapUserProvider.php | LdapUserProvider.loadUser | protected function loadUser($username, Entry $entry)
{
$password = null;
if (null !== $this->passwordAttribute) {
$password = $this->getAttributeValue($entry, $this->passwordAttribute);
}
return new User($username, $password, $this->defaultRoles);
} | php | protected function loadUser($username, Entry $entry)
{
$password = null;
if (null !== $this->passwordAttribute) {
$password = $this->getAttributeValue($entry, $this->passwordAttribute);
}
return new User($username, $password, $this->defaultRoles);
} | [
"protected",
"function",
"loadUser",
"(",
"$",
"username",
",",
"Entry",
"$",
"entry",
")",
"{",
"$",
"password",
"=",
"null",
";",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"passwordAttribute",
")",
"{",
"$",
"password",
"=",
"$",
"this",
"->",
"... | Loads a user from an LDAP entry.
@param string $username
@param Entry $entry
@return User | [
"Loads",
"a",
"user",
"from",
"an",
"LDAP",
"entry",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/User/LdapUserProvider.php#L123-L132 |
206,560 | symfony/symfony | src/Symfony/Component/Security/Core/User/LdapUserProvider.php | LdapUserProvider.getAttributeValue | private function getAttributeValue(Entry $entry, $attribute)
{
if (!$entry->hasAttribute($attribute)) {
throw new InvalidArgumentException(sprintf('Missing attribute "%s" for user "%s".', $attribute, $entry->getDn()));
}
$values = $entry->getAttribute($attribute);
if (1... | php | private function getAttributeValue(Entry $entry, $attribute)
{
if (!$entry->hasAttribute($attribute)) {
throw new InvalidArgumentException(sprintf('Missing attribute "%s" for user "%s".', $attribute, $entry->getDn()));
}
$values = $entry->getAttribute($attribute);
if (1... | [
"private",
"function",
"getAttributeValue",
"(",
"Entry",
"$",
"entry",
",",
"$",
"attribute",
")",
"{",
"if",
"(",
"!",
"$",
"entry",
"->",
"hasAttribute",
"(",
"$",
"attribute",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"... | Fetches a required unique attribute value from an LDAP entry.
@param Entry|null $entry
@param string $attribute | [
"Fetches",
"a",
"required",
"unique",
"attribute",
"value",
"from",
"an",
"LDAP",
"entry",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Security/Core/User/LdapUserProvider.php#L140-L153 |
206,561 | symfony/symfony | src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php | SwiftMailerHandler.flushMemorySpool | private function flushMemorySpool()
{
$mailerTransport = $this->mailer->getTransport();
if (!$mailerTransport instanceof \Swift_Transport_SpoolTransport) {
return;
}
$spool = $mailerTransport->getSpool();
if (!$spool instanceof \Swift_MemorySpool) {
r... | php | private function flushMemorySpool()
{
$mailerTransport = $this->mailer->getTransport();
if (!$mailerTransport instanceof \Swift_Transport_SpoolTransport) {
return;
}
$spool = $mailerTransport->getSpool();
if (!$spool instanceof \Swift_MemorySpool) {
r... | [
"private",
"function",
"flushMemorySpool",
"(",
")",
"{",
"$",
"mailerTransport",
"=",
"$",
"this",
"->",
"mailer",
"->",
"getTransport",
"(",
")",
";",
"if",
"(",
"!",
"$",
"mailerTransport",
"instanceof",
"\\",
"Swift_Transport_SpoolTransport",
")",
"{",
"re... | Flushes the mail queue if a memory spool is used. | [
"Flushes",
"the",
"mail",
"queue",
"if",
"a",
"memory",
"spool",
"is",
"used",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php#L75-L92 |
206,562 | symfony/symfony | src/Symfony/Component/Lock/Factory.php | Factory.createLock | public function createLock($resource, $ttl = 300.0, $autoRelease = true)
{
$lock = new Lock(new Key($resource), $this->store, $ttl, $autoRelease);
$lock->setLogger($this->logger);
return $lock;
} | php | public function createLock($resource, $ttl = 300.0, $autoRelease = true)
{
$lock = new Lock(new Key($resource), $this->store, $ttl, $autoRelease);
$lock->setLogger($this->logger);
return $lock;
} | [
"public",
"function",
"createLock",
"(",
"$",
"resource",
",",
"$",
"ttl",
"=",
"300.0",
",",
"$",
"autoRelease",
"=",
"true",
")",
"{",
"$",
"lock",
"=",
"new",
"Lock",
"(",
"new",
"Key",
"(",
"$",
"resource",
")",
",",
"$",
"this",
"->",
"store",... | Creates a lock for the given resource.
@param string $resource The resource to lock
@param float|null $ttl Maximum expected lock duration in seconds
@param bool $autoRelease Whether to automatically release the lock or not when the lock instance is destroyed
@return Lock | [
"Creates",
"a",
"lock",
"for",
"the",
"given",
"resource",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Lock/Factory.php#L45-L51 |
206,563 | symfony/symfony | src/Symfony/Component/Mime/Header/AbstractHeader.php | AbstractHeader.tokensToString | private function tokensToString(array $tokens): string
{
$lineCount = 0;
$headerLines = [];
$headerLines[] = $this->name.': ';
$currentLine = &$headerLines[$lineCount++];
// Build all tokens back into compliant header
foreach ($tokens as $i => $token) {
/... | php | private function tokensToString(array $tokens): string
{
$lineCount = 0;
$headerLines = [];
$headerLines[] = $this->name.': ';
$currentLine = &$headerLines[$lineCount++];
// Build all tokens back into compliant header
foreach ($tokens as $i => $token) {
/... | [
"private",
"function",
"tokensToString",
"(",
"array",
"$",
"tokens",
")",
":",
"string",
"{",
"$",
"lineCount",
"=",
"0",
";",
"$",
"headerLines",
"=",
"[",
"]",
";",
"$",
"headerLines",
"[",
"]",
"=",
"$",
"this",
"->",
"name",
".",
"': '",
";",
... | Takes an array of tokens which appear in the header and turns them into
an RFC 2822 compliant string, adding FWSP where needed.
@param string[] $tokens | [
"Takes",
"an",
"array",
"of",
"tokens",
"which",
"appear",
"in",
"the",
"header",
"and",
"turns",
"them",
"into",
"an",
"RFC",
"2822",
"compliant",
"string",
"adding",
"FWSP",
"where",
"needed",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Mime/Header/AbstractHeader.php#L255-L280 |
206,564 | symfony/symfony | src/Symfony/Component/BrowserKit/Client.php | Client.setMaxRedirects | public function setMaxRedirects($maxRedirects)
{
$this->maxRedirects = $maxRedirects < 0 ? -1 : $maxRedirects;
$this->followRedirects = -1 != $this->maxRedirects;
} | php | public function setMaxRedirects($maxRedirects)
{
$this->maxRedirects = $maxRedirects < 0 ? -1 : $maxRedirects;
$this->followRedirects = -1 != $this->maxRedirects;
} | [
"public",
"function",
"setMaxRedirects",
"(",
"$",
"maxRedirects",
")",
"{",
"$",
"this",
"->",
"maxRedirects",
"=",
"$",
"maxRedirects",
"<",
"0",
"?",
"-",
"1",
":",
"$",
"maxRedirects",
";",
"$",
"this",
"->",
"followRedirects",
"=",
"-",
"1",
"!=",
... | Sets the maximum number of redirects that crawler can follow.
@param int $maxRedirects | [
"Sets",
"the",
"maximum",
"number",
"of",
"redirects",
"that",
"crawler",
"can",
"follow",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L97-L101 |
206,565 | symfony/symfony | src/Symfony/Component/BrowserKit/Client.php | Client.getCrawler | public function getCrawler()
{
if (null === $this->crawler) {
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', \get_class($this).'::'.__FUNCTION__), E_USER_DEPRECATED);
// throw new BadM... | php | public function getCrawler()
{
if (null === $this->crawler) {
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', \get_class($this).'::'.__FUNCTION__), E_USER_DEPRECATED);
// throw new BadM... | [
"public",
"function",
"getCrawler",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"crawler",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",
"(",
"'Calling the \"%s()\" method before the \"request()\" one is deprecated since Symfony 4.1 and will throw an excep... | Returns the current Crawler instance.
@return Crawler A Crawler instance | [
"Returns",
"the",
"current",
"Crawler",
"instance",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L201-L209 |
206,566 | symfony/symfony | src/Symfony/Component/BrowserKit/Client.php | Client.getInternalResponse | public function getInternalResponse()
{
if (null === $this->internalResponse) {
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', \get_class($this).'::'.__FUNCTION__), E_USER_DEPRECATED);
... | php | public function getInternalResponse()
{
if (null === $this->internalResponse) {
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', \get_class($this).'::'.__FUNCTION__), E_USER_DEPRECATED);
... | [
"public",
"function",
"getInternalResponse",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"internalResponse",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",
"(",
"'Calling the \"%s()\" method before the \"request()\" one is deprecated since Symfony 4.1 and w... | Returns the current BrowserKit Response instance.
@return Response A BrowserKit Response instance | [
"Returns",
"the",
"current",
"BrowserKit",
"Response",
"instance",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L216-L224 |
206,567 | symfony/symfony | src/Symfony/Component/BrowserKit/Client.php | Client.getResponse | public function getResponse()
{
if (null === $this->response) {
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', \get_class($this).'::'.__FUNCTION__), E_USER_DEPRECATED);
// throw new Ba... | php | public function getResponse()
{
if (null === $this->response) {
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', \get_class($this).'::'.__FUNCTION__), E_USER_DEPRECATED);
// throw new Ba... | [
"public",
"function",
"getResponse",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"response",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",
"(",
"'Calling the \"%s()\" method before the \"request()\" one is deprecated since Symfony 4.1 and will throw an exc... | Returns the current origin response instance.
The origin response is the response instance that is returned
by the code that handles requests.
@return object A response instance
@see doRequest() | [
"Returns",
"the",
"current",
"origin",
"response",
"instance",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L236-L244 |
206,568 | symfony/symfony | src/Symfony/Component/BrowserKit/Client.php | Client.getInternalRequest | public function getInternalRequest()
{
if (null === $this->internalRequest) {
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', \get_class($this).'::'.__FUNCTION__), E_USER_DEPRECATED);
/... | php | public function getInternalRequest()
{
if (null === $this->internalRequest) {
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', \get_class($this).'::'.__FUNCTION__), E_USER_DEPRECATED);
/... | [
"public",
"function",
"getInternalRequest",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"internalRequest",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",
"(",
"'Calling the \"%s()\" method before the \"request()\" one is deprecated since Symfony 4.1 and wil... | Returns the current BrowserKit Request instance.
@return Request A BrowserKit Request instance | [
"Returns",
"the",
"current",
"BrowserKit",
"Request",
"instance",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L251-L259 |
206,569 | symfony/symfony | src/Symfony/Component/BrowserKit/Client.php | Client.getRequest | public function getRequest()
{
if (null === $this->request) {
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', \get_class($this).'::'.__FUNCTION__), E_USER_DEPRECATED);
// throw new BadM... | php | public function getRequest()
{
if (null === $this->request) {
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', \get_class($this).'::'.__FUNCTION__), E_USER_DEPRECATED);
// throw new BadM... | [
"public",
"function",
"getRequest",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"request",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",
"(",
"'Calling the \"%s()\" method before the \"request()\" one is deprecated since Symfony 4.1 and will throw an excep... | Returns the current origin Request instance.
The origin request is the request instance that is sent
to the code that handles requests.
@return object A Request instance
@see doRequest() | [
"Returns",
"the",
"current",
"origin",
"Request",
"instance",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L271-L279 |
206,570 | symfony/symfony | src/Symfony/Component/BrowserKit/Client.php | Client.submit | public function submit(Form $form, array $values = []/*, array $serverParameters = []*/)
{
if (\func_num_args() < 3 && __CLASS__ !== \get_class($this) && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject &... | php | public function submit(Form $form, array $values = []/*, array $serverParameters = []*/)
{
if (\func_num_args() < 3 && __CLASS__ !== \get_class($this) && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject &... | [
"public",
"function",
"submit",
"(",
"Form",
"$",
"form",
",",
"array",
"$",
"values",
"=",
"[",
"]",
"/*, array $serverParameters = []*/",
")",
"{",
"if",
"(",
"\\",
"func_num_args",
"(",
")",
"<",
"3",
"&&",
"__CLASS__",
"!==",
"\\",
"get_class",
"(",
... | Submits a form.
@param Form $form A Form instance
@param array $values An array of form field values
@param array $serverParameters An array of server parameters
@return Crawler | [
"Submits",
"a",
"form",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L318-L328 |
206,571 | symfony/symfony | src/Symfony/Component/BrowserKit/Client.php | Client.submitForm | public function submitForm(string $button, array $fieldValues = [], string $method = 'POST', array $serverParameters = []): Crawler
{
if (null === $this->crawler) {
throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
}
$... | php | public function submitForm(string $button, array $fieldValues = [], string $method = 'POST', array $serverParameters = []): Crawler
{
if (null === $this->crawler) {
throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
}
$... | [
"public",
"function",
"submitForm",
"(",
"string",
"$",
"button",
",",
"array",
"$",
"fieldValues",
"=",
"[",
"]",
",",
"string",
"$",
"method",
"=",
"'POST'",
",",
"array",
"$",
"serverParameters",
"=",
"[",
"]",
")",
":",
"Crawler",
"{",
"if",
"(",
... | Finds the first form that contains a button with the given content and
uses it to submit the given form field values.
@param string $button The text content, id, value or name of the form <button> or <input type="submit">
@param array $fieldValues Use this syntax: ['my_form[name]' => '...', 'my_form[em... | [
"Finds",
"the",
"first",
"form",
"that",
"contains",
"a",
"button",
"with",
"the",
"given",
"content",
"and",
"uses",
"it",
"to",
"submit",
"the",
"given",
"form",
"field",
"values",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L339-L349 |
206,572 | symfony/symfony | src/Symfony/Component/BrowserKit/Client.php | Client.createCrawlerFromContent | protected function createCrawlerFromContent($uri, $content, $type)
{
if (!class_exists('Symfony\Component\DomCrawler\Crawler')) {
return;
}
$crawler = new Crawler(null, $uri);
$crawler->addContent($content, $type);
return $crawler;
} | php | protected function createCrawlerFromContent($uri, $content, $type)
{
if (!class_exists('Symfony\Component\DomCrawler\Crawler')) {
return;
}
$crawler = new Crawler(null, $uri);
$crawler->addContent($content, $type);
return $crawler;
} | [
"protected",
"function",
"createCrawlerFromContent",
"(",
"$",
"uri",
",",
"$",
"content",
",",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"'Symfony\\Component\\DomCrawler\\Crawler'",
")",
")",
"{",
"return",
";",
"}",
"$",
"crawler",
"=",
"... | Creates a crawler.
This method returns null if the DomCrawler component is not available.
@param string $uri A URI
@param string $content Content for the crawler to use
@param string $type Content type
@return Crawler|null | [
"Creates",
"a",
"crawler",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L532-L542 |
206,573 | symfony/symfony | src/Symfony/Component/BrowserKit/Client.php | Client.back | public function back()
{
do {
$request = $this->history->back();
} while (\array_key_exists(serialize($request), $this->redirects));
return $this->requestFromRequest($request, false);
} | php | public function back()
{
do {
$request = $this->history->back();
} while (\array_key_exists(serialize($request), $this->redirects));
return $this->requestFromRequest($request, false);
} | [
"public",
"function",
"back",
"(",
")",
"{",
"do",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"history",
"->",
"back",
"(",
")",
";",
"}",
"while",
"(",
"\\",
"array_key_exists",
"(",
"serialize",
"(",
"$",
"request",
")",
",",
"$",
"this",
"->",... | Goes back in the browser history.
@return Crawler | [
"Goes",
"back",
"in",
"the",
"browser",
"history",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L549-L556 |
206,574 | symfony/symfony | src/Symfony/Component/BrowserKit/Client.php | Client.getAbsoluteUri | protected function getAbsoluteUri($uri)
{
// already absolute?
if (0 === strpos($uri, 'http://') || 0 === strpos($uri, 'https://')) {
return $uri;
}
if (!$this->history->isEmpty()) {
$currentUri = $this->history->current()->getUri();
} else {
... | php | protected function getAbsoluteUri($uri)
{
// already absolute?
if (0 === strpos($uri, 'http://') || 0 === strpos($uri, 'https://')) {
return $uri;
}
if (!$this->history->isEmpty()) {
$currentUri = $this->history->current()->getUri();
} else {
... | [
"protected",
"function",
"getAbsoluteUri",
"(",
"$",
"uri",
")",
"{",
"// already absolute?",
"if",
"(",
"0",
"===",
"strpos",
"(",
"$",
"uri",
",",
"'http://'",
")",
"||",
"0",
"===",
"strpos",
"(",
"$",
"uri",
",",
"'https://'",
")",
")",
"{",
"retur... | Takes a URI and converts it to absolute if it is not already absolute.
@param string $uri A URI
@return string An absolute URI | [
"Takes",
"a",
"URI",
"and",
"converts",
"it",
"to",
"absolute",
"if",
"it",
"is",
"not",
"already",
"absolute",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L666-L703 |
206,575 | symfony/symfony | src/Symfony/Component/BrowserKit/Client.php | Client.requestFromRequest | protected function requestFromRequest(Request $request, $changeHistory = true)
{
return $this->request($request->getMethod(), $request->getUri(), $request->getParameters(), $request->getFiles(), $request->getServer(), $request->getContent(), $changeHistory);
} | php | protected function requestFromRequest(Request $request, $changeHistory = true)
{
return $this->request($request->getMethod(), $request->getUri(), $request->getParameters(), $request->getFiles(), $request->getServer(), $request->getContent(), $changeHistory);
} | [
"protected",
"function",
"requestFromRequest",
"(",
"Request",
"$",
"request",
",",
"$",
"changeHistory",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"request",
"(",
"$",
"request",
"->",
"getMethod",
"(",
")",
",",
"$",
"request",
"->",
"getUri",
... | Makes a request from a Request object directly.
@param Request $request A Request instance
@param bool $changeHistory Whether to update the history or not (only used internally for back(), forward(), and reload())
@return Crawler | [
"Makes",
"a",
"request",
"from",
"a",
"Request",
"object",
"directly",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/BrowserKit/Client.php#L713-L716 |
206,576 | symfony/symfony | src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php | AbstractDumper.setOutput | public function setOutput($output)
{
$prev = null !== $this->outputStream ? $this->outputStream : $this->lineDumper;
if (\is_callable($output)) {
$this->outputStream = null;
$this->lineDumper = $output;
} else {
if (\is_string($output)) {
... | php | public function setOutput($output)
{
$prev = null !== $this->outputStream ? $this->outputStream : $this->lineDumper;
if (\is_callable($output)) {
$this->outputStream = null;
$this->lineDumper = $output;
} else {
if (\is_string($output)) {
... | [
"public",
"function",
"setOutput",
"(",
"$",
"output",
")",
"{",
"$",
"prev",
"=",
"null",
"!==",
"$",
"this",
"->",
"outputStream",
"?",
"$",
"this",
"->",
"outputStream",
":",
"$",
"this",
"->",
"lineDumper",
";",
"if",
"(",
"\\",
"is_callable",
"(",... | Sets the output destination of the dumps.
@param callable|resource|string $output A line dumper callable, an opened stream or an output path
@return callable|resource|string The previous output destination | [
"Sets",
"the",
"output",
"destination",
"of",
"the",
"dumps",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php#L64-L80 |
206,577 | symfony/symfony | src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php | AbstractDumper.setCharset | public function setCharset($charset)
{
$prev = $this->charset;
$charset = strtoupper($charset);
$charset = null === $charset || 'UTF-8' === $charset || 'UTF8' === $charset ? 'CP1252' : $charset;
$this->charset = $charset;
return $prev;
} | php | public function setCharset($charset)
{
$prev = $this->charset;
$charset = strtoupper($charset);
$charset = null === $charset || 'UTF-8' === $charset || 'UTF8' === $charset ? 'CP1252' : $charset;
$this->charset = $charset;
return $prev;
} | [
"public",
"function",
"setCharset",
"(",
"$",
"charset",
")",
"{",
"$",
"prev",
"=",
"$",
"this",
"->",
"charset",
";",
"$",
"charset",
"=",
"strtoupper",
"(",
"$",
"charset",
")",
";",
"$",
"charset",
"=",
"null",
"===",
"$",
"charset",
"||",
"'UTF-... | Sets the default character encoding to use for non-UTF8 strings.
@param string $charset The default character encoding to use for non-UTF8 strings
@return string The previous charset | [
"Sets",
"the",
"default",
"character",
"encoding",
"to",
"use",
"for",
"non",
"-",
"UTF8",
"strings",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php#L89-L99 |
206,578 | symfony/symfony | src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php | AbstractDumper.dump | public function dump(Data $data, $output = null)
{
$this->decimalPoint = localeconv();
$this->decimalPoint = $this->decimalPoint['decimal_point'];
if ($locale = $this->flags & (self::DUMP_COMMA_SEPARATOR | self::DUMP_TRAILING_COMMA) ? setlocale(LC_NUMERIC, 0) : null) {
setlocale... | php | public function dump(Data $data, $output = null)
{
$this->decimalPoint = localeconv();
$this->decimalPoint = $this->decimalPoint['decimal_point'];
if ($locale = $this->flags & (self::DUMP_COMMA_SEPARATOR | self::DUMP_TRAILING_COMMA) ? setlocale(LC_NUMERIC, 0) : null) {
setlocale... | [
"public",
"function",
"dump",
"(",
"Data",
"$",
"data",
",",
"$",
"output",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"decimalPoint",
"=",
"localeconv",
"(",
")",
";",
"$",
"this",
"->",
"decimalPoint",
"=",
"$",
"this",
"->",
"decimalPoint",
"[",
"'... | Dumps a Data object.
@param Data $data A Data object
@param callable|resource|string|true|null $output A line dumper callable, an opened stream, an output path or true to return the dump
@return string|null The dump as string when $output is true | [
"Dumps",
"a",
"Data",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php#L124-L157 |
206,579 | symfony/symfony | src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php | AbstractDumper.dumpLine | protected function dumpLine($depth)
{
($this->lineDumper)($this->line, $depth, $this->indentPad);
$this->line = '';
} | php | protected function dumpLine($depth)
{
($this->lineDumper)($this->line, $depth, $this->indentPad);
$this->line = '';
} | [
"protected",
"function",
"dumpLine",
"(",
"$",
"depth",
")",
"{",
"(",
"$",
"this",
"->",
"lineDumper",
")",
"(",
"$",
"this",
"->",
"line",
",",
"$",
"depth",
",",
"$",
"this",
"->",
"indentPad",
")",
";",
"$",
"this",
"->",
"line",
"=",
"''",
"... | Dumps the current line.
@param int $depth The recursive depth in the dumped structure for the line being dumped,
or -1 to signal the end-of-dump to the line dumper callable | [
"Dumps",
"the",
"current",
"line",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php#L165-L169 |
206,580 | symfony/symfony | src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php | AbstractDumper.utf8Encode | protected function utf8Encode($s)
{
if (preg_match('//u', $s)) {
return $s;
}
if (!\function_exists('iconv')) {
throw new \RuntimeException('Unable to convert a non-UTF-8 string to UTF-8: required function iconv() does not exist. You should install ext-iconv or symfo... | php | protected function utf8Encode($s)
{
if (preg_match('//u', $s)) {
return $s;
}
if (!\function_exists('iconv')) {
throw new \RuntimeException('Unable to convert a non-UTF-8 string to UTF-8: required function iconv() does not exist. You should install ext-iconv or symfo... | [
"protected",
"function",
"utf8Encode",
"(",
"$",
"s",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'//u'",
",",
"$",
"s",
")",
")",
"{",
"return",
"$",
"s",
";",
"}",
"if",
"(",
"!",
"\\",
"function_exists",
"(",
"'iconv'",
")",
")",
"{",
"throw",
"n... | Converts a non-UTF-8 string to UTF-8.
@param string $s The non-UTF-8 string to convert
@return string The string converted to UTF-8 | [
"Converts",
"a",
"non",
"-",
"UTF",
"-",
"8",
"string",
"to",
"UTF",
"-",
"8",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php#L192-L210 |
206,581 | symfony/symfony | src/Symfony/Component/Console/Descriptor/XmlDescriptor.php | XmlDescriptor.appendDocument | private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent)
{
foreach ($importedParent->childNodes as $childNode) {
$parentNode->appendChild($parentNode->ownerDocument->importNode($childNode, true));
}
} | php | private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent)
{
foreach ($importedParent->childNodes as $childNode) {
$parentNode->appendChild($parentNode->ownerDocument->importNode($childNode, true));
}
} | [
"private",
"function",
"appendDocument",
"(",
"\\",
"DOMNode",
"$",
"parentNode",
",",
"\\",
"DOMNode",
"$",
"importedParent",
")",
"{",
"foreach",
"(",
"$",
"importedParent",
"->",
"childNodes",
"as",
"$",
"childNode",
")",
"{",
"$",
"parentNode",
"->",
"ap... | Appends document children to parent node. | [
"Appends",
"document",
"children",
"to",
"parent",
"node",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Descriptor/XmlDescriptor.php#L173-L178 |
206,582 | symfony/symfony | src/Symfony/Component/Console/Descriptor/XmlDescriptor.php | XmlDescriptor.writeDocument | private function writeDocument(\DOMDocument $dom)
{
$dom->formatOutput = true;
$this->write($dom->saveXML());
} | php | private function writeDocument(\DOMDocument $dom)
{
$dom->formatOutput = true;
$this->write($dom->saveXML());
} | [
"private",
"function",
"writeDocument",
"(",
"\\",
"DOMDocument",
"$",
"dom",
")",
"{",
"$",
"dom",
"->",
"formatOutput",
"=",
"true",
";",
"$",
"this",
"->",
"write",
"(",
"$",
"dom",
"->",
"saveXML",
"(",
")",
")",
";",
"}"
] | Writes DOM document.
@return \DOMDocument|string | [
"Writes",
"DOM",
"document",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Descriptor/XmlDescriptor.php#L185-L189 |
206,583 | symfony/symfony | src/Symfony/Component/CssSelector/XPath/XPathExpr.php | XPathExpr.join | public function join(string $combiner, self $expr): self
{
$path = $this->__toString().$combiner;
if ('*/' !== $expr->path) {
$path .= $expr->path;
}
$this->path = $path;
$this->element = $expr->element;
$this->condition = $expr->condition;
retu... | php | public function join(string $combiner, self $expr): self
{
$path = $this->__toString().$combiner;
if ('*/' !== $expr->path) {
$path .= $expr->path;
}
$this->path = $path;
$this->element = $expr->element;
$this->condition = $expr->condition;
retu... | [
"public",
"function",
"join",
"(",
"string",
"$",
"combiner",
",",
"self",
"$",
"expr",
")",
":",
"self",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"__toString",
"(",
")",
".",
"$",
"combiner",
";",
"if",
"(",
"'*/'",
"!==",
"$",
"expr",
"->",
"p... | Joins another XPathExpr with a combiner.
@return $this | [
"Joins",
"another",
"XPathExpr",
"with",
"a",
"combiner",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/CssSelector/XPath/XPathExpr.php#L80-L93 |
206,584 | symfony/symfony | src/Symfony/Component/HttpClient/NativeHttpClient.php | NativeHttpClient.getProxy | private static function getProxy(?string $proxy, array $url): ?array
{
if (null === $proxy) {
// Ignore HTTP_PROXY except on the CLI to work around httpoxy set of vulnerabilities
$proxy = $_SERVER['http_proxy'] ?? (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? $_SERVER['HTTP_PROXY'... | php | private static function getProxy(?string $proxy, array $url): ?array
{
if (null === $proxy) {
// Ignore HTTP_PROXY except on the CLI to work around httpoxy set of vulnerabilities
$proxy = $_SERVER['http_proxy'] ?? (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? $_SERVER['HTTP_PROXY'... | [
"private",
"static",
"function",
"getProxy",
"(",
"?",
"string",
"$",
"proxy",
",",
"array",
"$",
"url",
")",
":",
"?",
"array",
"{",
"if",
"(",
"null",
"===",
"$",
"proxy",
")",
"{",
"// Ignore HTTP_PROXY except on the CLI to work around httpoxy set of vulnerabil... | Loads proxy configuration from the same environment variables as curl when no proxy is explicitly set. | [
"Loads",
"proxy",
"configuration",
"from",
"the",
"same",
"environment",
"variables",
"as",
"curl",
"when",
"no",
"proxy",
"is",
"explicitly",
"set",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/NativeHttpClient.php#L249-L282 |
206,585 | symfony/symfony | src/Symfony/Component/HttpClient/NativeHttpClient.php | NativeHttpClient.dnsResolve | private static function dnsResolve(array $url, NativeClientState $multi, array &$info, ?\Closure $onProgress): array
{
if ($port = parse_url($url['authority'], PHP_URL_PORT) ?: '') {
$info['primary_port'] = $port;
$port = ':'.$port;
} else {
$info['primary_port'] ... | php | private static function dnsResolve(array $url, NativeClientState $multi, array &$info, ?\Closure $onProgress): array
{
if ($port = parse_url($url['authority'], PHP_URL_PORT) ?: '') {
$info['primary_port'] = $port;
$port = ':'.$port;
} else {
$info['primary_port'] ... | [
"private",
"static",
"function",
"dnsResolve",
"(",
"array",
"$",
"url",
",",
"NativeClientState",
"$",
"multi",
",",
"array",
"&",
"$",
"info",
",",
"?",
"\\",
"Closure",
"$",
"onProgress",
")",
":",
"array",
"{",
"if",
"(",
"$",
"port",
"=",
"parse_u... | Resolves the IP of the host using the local DNS cache if possible. | [
"Resolves",
"the",
"IP",
"of",
"the",
"host",
"using",
"the",
"local",
"DNS",
"cache",
"if",
"possible",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpClient/NativeHttpClient.php#L287-L317 |
206,586 | symfony/symfony | src/Symfony/Component/Console/Helper/Helper.php | Helper.substr | public static function substr($string, $from, $length = null)
{
if (false === $encoding = mb_detect_encoding($string, null, true)) {
return substr($string, $from, $length);
}
return mb_substr($string, $from, $length, $encoding);
} | php | public static function substr($string, $from, $length = null)
{
if (false === $encoding = mb_detect_encoding($string, null, true)) {
return substr($string, $from, $length);
}
return mb_substr($string, $from, $length, $encoding);
} | [
"public",
"static",
"function",
"substr",
"(",
"$",
"string",
",",
"$",
"from",
",",
"$",
"length",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"encoding",
"=",
"mb_detect_encoding",
"(",
"$",
"string",
",",
"null",
",",
"true",
")",
")",
... | Returns the subset of a string, using mb_substr if it is available.
@param string $string String to subset
@param int $from Start offset
@param int|null $length Length to read
@return string The string subset | [
"Returns",
"the",
"subset",
"of",
"a",
"string",
"using",
"mb_substr",
"if",
"it",
"is",
"available",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Console/Helper/Helper.php#L66-L73 |
206,587 | symfony/symfony | src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php | ExceptionController.templateExists | protected function templateExists($template)
{
$template = (string) $template;
$loader = $this->twig->getLoader();
if ($loader instanceof ExistsLoaderInterface || method_exists($loader, 'exists')) {
return $loader->exists($template);
}
try {
$loader-... | php | protected function templateExists($template)
{
$template = (string) $template;
$loader = $this->twig->getLoader();
if ($loader instanceof ExistsLoaderInterface || method_exists($loader, 'exists')) {
return $loader->exists($template);
}
try {
$loader-... | [
"protected",
"function",
"templateExists",
"(",
"$",
"template",
")",
"{",
"$",
"template",
"=",
"(",
"string",
")",
"$",
"template",
";",
"$",
"loader",
"=",
"$",
"this",
"->",
"twig",
"->",
"getLoader",
"(",
")",
";",
"if",
"(",
"$",
"loader",
"ins... | to be removed when the minimum required version of Twig is >= 3.0 | [
"to",
"be",
"removed",
"when",
"the",
"minimum",
"required",
"version",
"of",
"Twig",
"is",
">",
"=",
"3",
".",
"0"
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php#L126-L143 |
206,588 | symfony/symfony | src/Symfony/Component/Translation/Loader/PoFileLoader.php | PoFileLoader.addMessage | private function addMessage(array &$messages, array $item)
{
if (\is_array($item['translated'])) {
$messages[stripcslashes($item['ids']['singular'])] = stripcslashes($item['translated'][0]);
if (isset($item['ids']['plural'])) {
$plurals = $item['translated'];
... | php | private function addMessage(array &$messages, array $item)
{
if (\is_array($item['translated'])) {
$messages[stripcslashes($item['ids']['singular'])] = stripcslashes($item['translated'][0]);
if (isset($item['ids']['plural'])) {
$plurals = $item['translated'];
... | [
"private",
"function",
"addMessage",
"(",
"array",
"&",
"$",
"messages",
",",
"array",
"$",
"item",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"item",
"[",
"'translated'",
"]",
")",
")",
"{",
"$",
"messages",
"[",
"stripcslashes",
"(",
"$",
"it... | Save a translation item to the messages.
A .po file could contain by error missing plural indexes. We need to
fix these before saving them. | [
"Save",
"a",
"translation",
"item",
"to",
"the",
"messages",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Translation/Loader/PoFileLoader.php#L127-L147 |
206,589 | symfony/symfony | src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php | FormDataExtractor.buildId | private function buildId(FormInterface $form)
{
$id = $form->getName();
if (null !== $form->getParent()) {
$id = $this->buildId($form->getParent()).'_'.$id;
}
return $id;
} | php | private function buildId(FormInterface $form)
{
$id = $form->getName();
if (null !== $form->getParent()) {
$id = $this->buildId($form->getParent()).'_'.$id;
}
return $id;
} | [
"private",
"function",
"buildId",
"(",
"FormInterface",
"$",
"form",
")",
"{",
"$",
"id",
"=",
"$",
"form",
"->",
"getName",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"form",
"->",
"getParent",
"(",
")",
")",
"{",
"$",
"id",
"=",
"$",
"this",... | Recursively builds an HTML ID for a form.
@return string The HTML ID | [
"Recursively",
"builds",
"an",
"HTML",
"ID",
"for",
"a",
"form",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php#L160-L169 |
206,590 | symfony/symfony | src/Symfony/Component/Serializer/Encoder/ChainDecoder.php | ChainDecoder.getDecoder | private function getDecoder(string $format, array $context): DecoderInterface
{
if (isset($this->decoderByFormat[$format])
&& isset($this->decoders[$this->decoderByFormat[$format]])
) {
return $this->decoders[$this->decoderByFormat[$format]];
}
foreach ($this... | php | private function getDecoder(string $format, array $context): DecoderInterface
{
if (isset($this->decoderByFormat[$format])
&& isset($this->decoders[$this->decoderByFormat[$format]])
) {
return $this->decoders[$this->decoderByFormat[$format]];
}
foreach ($this... | [
"private",
"function",
"getDecoder",
"(",
"string",
"$",
"format",
",",
"array",
"$",
"context",
")",
":",
"DecoderInterface",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"decoderByFormat",
"[",
"$",
"format",
"]",
")",
"&&",
"isset",
"(",
"$",
"t... | Gets the decoder supporting the format.
@throws RuntimeException if no decoder is found | [
"Gets",
"the",
"decoder",
"supporting",
"the",
"format",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Serializer/Encoder/ChainDecoder.php#L62-L79 |
206,591 | symfony/symfony | src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php | RequestDataCollector.parseController | protected function parseController($controller)
{
if (\is_string($controller) && false !== strpos($controller, '::')) {
$controller = explode('::', $controller);
}
if (\is_array($controller)) {
try {
$r = new \ReflectionMethod($controller[0], $control... | php | protected function parseController($controller)
{
if (\is_string($controller) && false !== strpos($controller, '::')) {
$controller = explode('::', $controller);
}
if (\is_array($controller)) {
try {
$r = new \ReflectionMethod($controller[0], $control... | [
"protected",
"function",
"parseController",
"(",
"$",
"controller",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"controller",
")",
"&&",
"false",
"!==",
"strpos",
"(",
"$",
"controller",
",",
"'::'",
")",
")",
"{",
"$",
"controller",
"=",
"explode"... | Parse a controller.
@param mixed $controller The controller to parse
@return array|string An array of controller data or a simple string | [
"Parse",
"a",
"controller",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php#L398-L463 |
206,592 | symfony/symfony | src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php | FragmentHandler.deliver | protected function deliver(Response $response)
{
if (!$response->isSuccessful()) {
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $this->requestStack->getCurrentRequest()->getUri(), $response->getStatusCode()));
}
if (!$response instanceof ... | php | protected function deliver(Response $response)
{
if (!$response->isSuccessful()) {
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $this->requestStack->getCurrentRequest()->getUri(), $response->getStatusCode()));
}
if (!$response instanceof ... | [
"protected",
"function",
"deliver",
"(",
"Response",
"$",
"response",
")",
"{",
"if",
"(",
"!",
"$",
"response",
"->",
"isSuccessful",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"sprintf",
"(",
"'Error when rendering \"%s\" (Status code i... | Delivers the Response as a string.
When the Response is a StreamedResponse, the content is streamed immediately
instead of being returned.
@return string|null The Response content or null when the Response is streamed
@throws \RuntimeException when the Response is not successful | [
"Delivers",
"the",
"Response",
"as",
"a",
"string",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php#L100-L111 |
206,593 | symfony/symfony | src/Symfony/Component/Lock/Store/RedisStore.php | RedisStore.evaluate | private function evaluate(string $script, string $resource, array $args)
{
if (
$this->redis instanceof \Redis ||
$this->redis instanceof \RedisCluster ||
$this->redis instanceof RedisProxy ||
$this->redis instanceof RedisClusterProxy
) {
r... | php | private function evaluate(string $script, string $resource, array $args)
{
if (
$this->redis instanceof \Redis ||
$this->redis instanceof \RedisCluster ||
$this->redis instanceof RedisProxy ||
$this->redis instanceof RedisClusterProxy
) {
r... | [
"private",
"function",
"evaluate",
"(",
"string",
"$",
"script",
",",
"string",
"$",
"resource",
",",
"array",
"$",
"args",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"redis",
"instanceof",
"\\",
"Redis",
"||",
"$",
"this",
"->",
"redis",
"instanceof",
"\... | Evaluates a script in the corresponding redis client.
@return mixed | [
"Evaluates",
"a",
"script",
"in",
"the",
"corresponding",
"redis",
"client",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/Lock/Store/RedisStore.php#L132-L152 |
206,594 | symfony/symfony | src/Symfony/Component/PropertyAccess/PropertyAccessor.php | PropertyAccessor.readIndex | private function readIndex($zval, $index)
{
if (!$zval[self::VALUE] instanceof \ArrayAccess && !\is_array($zval[self::VALUE])) {
throw new NoSuchIndexException(sprintf('Cannot read index "%s" from object of type "%s" because it doesn\'t implement \ArrayAccess.', $index, \get_class($zval[self::VA... | php | private function readIndex($zval, $index)
{
if (!$zval[self::VALUE] instanceof \ArrayAccess && !\is_array($zval[self::VALUE])) {
throw new NoSuchIndexException(sprintf('Cannot read index "%s" from object of type "%s" because it doesn\'t implement \ArrayAccess.', $index, \get_class($zval[self::VA... | [
"private",
"function",
"readIndex",
"(",
"$",
"zval",
",",
"$",
"index",
")",
"{",
"if",
"(",
"!",
"$",
"zval",
"[",
"self",
"::",
"VALUE",
"]",
"instanceof",
"\\",
"ArrayAccess",
"&&",
"!",
"\\",
"is_array",
"(",
"$",
"zval",
"[",
"self",
"::",
"V... | Reads a key from an array-like structure.
@param array $zval The array containing the array or \ArrayAccess object to read from
@param string|int $index The key to read
@return array The array containing the value of the key
@throws NoSuchIndexException If the array does not implement \ArrayAccess or it is not... | [
"Reads",
"a",
"key",
"from",
"an",
"array",
"-",
"like",
"structure",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L351-L372 |
206,595 | symfony/symfony | src/Symfony/Component/PropertyAccess/PropertyAccessor.php | PropertyAccessor.readProperty | private function readProperty($zval, $property, bool $ignoreInvalidProperty = false)
{
if (!\is_object($zval[self::VALUE])) {
throw new NoSuchPropertyException(sprintf('Cannot read property "%s" from an array. Maybe you intended to write the property path as "[%1$s]" instead.', $property));
... | php | private function readProperty($zval, $property, bool $ignoreInvalidProperty = false)
{
if (!\is_object($zval[self::VALUE])) {
throw new NoSuchPropertyException(sprintf('Cannot read property "%s" from an array. Maybe you intended to write the property path as "[%1$s]" instead.', $property));
... | [
"private",
"function",
"readProperty",
"(",
"$",
"zval",
",",
"$",
"property",
",",
"bool",
"$",
"ignoreInvalidProperty",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"\\",
"is_object",
"(",
"$",
"zval",
"[",
"self",
"::",
"VALUE",
"]",
")",
")",
"{",
"th... | Reads the a property from an object.
@param array $zval The array containing the object to read from
@param string $property The property to read
@param bool $ignoreInvalidProperty Whether to ignore invalid property or throw an exception
@return array The array containing the value of... | [
"Reads",
"the",
"a",
"property",
"from",
"an",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L385-L427 |
206,596 | symfony/symfony | src/Symfony/Component/PropertyAccess/PropertyAccessor.php | PropertyAccessor.writeIndex | private function writeIndex($zval, $index, $value)
{
if (!$zval[self::VALUE] instanceof \ArrayAccess && !\is_array($zval[self::VALUE])) {
throw new NoSuchIndexException(sprintf('Cannot modify index "%s" in object of type "%s" because it doesn\'t implement \ArrayAccess.', $index, \get_class($zval... | php | private function writeIndex($zval, $index, $value)
{
if (!$zval[self::VALUE] instanceof \ArrayAccess && !\is_array($zval[self::VALUE])) {
throw new NoSuchIndexException(sprintf('Cannot modify index "%s" in object of type "%s" because it doesn\'t implement \ArrayAccess.', $index, \get_class($zval... | [
"private",
"function",
"writeIndex",
"(",
"$",
"zval",
",",
"$",
"index",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"zval",
"[",
"self",
"::",
"VALUE",
"]",
"instanceof",
"\\",
"ArrayAccess",
"&&",
"!",
"\\",
"is_array",
"(",
"$",
"zval",
"... | Sets the value of an index in a given array-accessible value.
@param array $zval The array containing the array or \ArrayAccess object to write to
@param string|int $index The index to write at
@param mixed $value The value to write
@throws NoSuchIndexException If the array does not implement \ArrayAccess ... | [
"Sets",
"the",
"value",
"of",
"an",
"index",
"in",
"a",
"given",
"array",
"-",
"accessible",
"value",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L522-L529 |
206,597 | symfony/symfony | src/Symfony/Component/PropertyAccess/PropertyAccessor.php | PropertyAccessor.writeProperty | private function writeProperty($zval, $property, $value)
{
if (!\is_object($zval[self::VALUE])) {
throw new NoSuchPropertyException(sprintf('Cannot write property "%s" to an array. Maybe you should write the property path as "[%1$s]" instead?', $property));
}
$object = $zval[sel... | php | private function writeProperty($zval, $property, $value)
{
if (!\is_object($zval[self::VALUE])) {
throw new NoSuchPropertyException(sprintf('Cannot write property "%s" to an array. Maybe you should write the property path as "[%1$s]" instead?', $property));
}
$object = $zval[sel... | [
"private",
"function",
"writeProperty",
"(",
"$",
"zval",
",",
"$",
"property",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"\\",
"is_object",
"(",
"$",
"zval",
"[",
"self",
"::",
"VALUE",
"]",
")",
")",
"{",
"throw",
"new",
"NoSuchPropertyException",... | Sets the value of a property in the given object.
@param array $zval The array containing the object to write to
@param string $property The property to write
@param mixed $value The value to write
@throws NoSuchPropertyException if the property does not exist or is not public | [
"Sets",
"the",
"value",
"of",
"a",
"property",
"in",
"the",
"given",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L540-L570 |
206,598 | symfony/symfony | src/Symfony/Component/PropertyAccess/PropertyAccessor.php | PropertyAccessor.isPropertyWritable | private function isPropertyWritable($object, string $property): bool
{
if (!\is_object($object)) {
return false;
}
$access = $this->getWriteAccessInfo(\get_class($object), $property, []);
$isWritable = self::ACCESS_TYPE_METHOD === $access[self::ACCESS_TYPE]
... | php | private function isPropertyWritable($object, string $property): bool
{
if (!\is_object($object)) {
return false;
}
$access = $this->getWriteAccessInfo(\get_class($object), $property, []);
$isWritable = self::ACCESS_TYPE_METHOD === $access[self::ACCESS_TYPE]
... | [
"private",
"function",
"isPropertyWritable",
"(",
"$",
"object",
",",
"string",
"$",
"property",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"\\",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"access",
"=",
"$",
"this"... | Returns whether a property is writable in the given object.
@param object $object The object to write to | [
"Returns",
"whether",
"a",
"property",
"is",
"writable",
"in",
"the",
"given",
"object",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L708-L733 |
206,599 | symfony/symfony | src/Symfony/Component/PropertyAccess/PropertyAccessor.php | PropertyAccessor.getPropertyPath | private function getPropertyPath($propertyPath): PropertyPath
{
if ($propertyPath instanceof PropertyPathInterface) {
// Don't call the copy constructor has it is not needed here
return $propertyPath;
}
if (isset($this->propertyPathCache[$propertyPath])) {
... | php | private function getPropertyPath($propertyPath): PropertyPath
{
if ($propertyPath instanceof PropertyPathInterface) {
// Don't call the copy constructor has it is not needed here
return $propertyPath;
}
if (isset($this->propertyPathCache[$propertyPath])) {
... | [
"private",
"function",
"getPropertyPath",
"(",
"$",
"propertyPath",
")",
":",
"PropertyPath",
"{",
"if",
"(",
"$",
"propertyPath",
"instanceof",
"PropertyPathInterface",
")",
"{",
"// Don't call the copy constructor has it is not needed here",
"return",
"$",
"propertyPath",... | Gets a PropertyPath instance and caches it.
@param string|PropertyPath $propertyPath | [
"Gets",
"a",
"PropertyPath",
"instance",
"and",
"caches",
"it",
"."
] | b82b09eefb084e487997f4af753400d721edd0a8 | https://github.com/symfony/symfony/blob/b82b09eefb084e487997f4af753400d721edd0a8/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L789-L814 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.