language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Auth/DatabaseUserProvider.php | @@ -8,7 +8,6 @@
use Illuminate\Contracts\Hashing\Hasher as HasherContract;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Database\ConnectionInterface;
-use Illuminate\Support\Str;
class DatabaseUserProvider implements UserProvider
{
@@ -112,7 +111,7 @@ public function retrieveByCredentials(array $credentials)
$query = $this->connection->table($this->table);
foreach ($credentials as $key => $value) {
- if (Str::contains($key, 'password')) {
+ if (str_contains($key, 'password')) {
continue;
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Auth/EloquentUserProvider.php | @@ -7,7 +7,6 @@
use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Contracts\Hashing\Hasher as HasherContract;
use Illuminate\Contracts\Support\Arrayable;
-use Illuminate\Support\Str;
class EloquentUserProvider implements UserProvider
{
@@ -108,7 +107,7 @@ public function retrieveByCredentials(array $credentials)
{
if (empty($credentials) ||
(count($credentials) === 1 &&
- Str::contains($this->firstCredentialKey($credentials), 'password'))) {
+ str_contains($this->firstCredentialKey($credentials), 'password'))) {
return;
}
@@ -118,7 +117,7 @@ public function retrieveByCredentials(array $credentials)
$query = $this->newModelQuery();
foreach ($credentials as $key => $value) {
- if (Str::contains($key, 'password')) {
+ if (str_contains($key, 'password')) {
continue;
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Auth/Passwords/PasswordBrokerManager.php | @@ -3,7 +3,6 @@
namespace Illuminate\Auth\Passwords;
use Illuminate\Contracts\Auth\PasswordBrokerFactory as FactoryContract;
-use Illuminate\Support\Str;
use InvalidArgumentException;
/**
@@ -84,7 +83,7 @@ protected function createTokenRepository(array $config)
{
$key = $this->app['config']['app.key'];
- if (Str::startsWith($key, 'base64:')) {
+ if (str_starts_with($key, 'base64:')) {
$key = base64_decode(substr($key, 7));
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Auth/Recaller.php | @@ -2,8 +2,6 @@
namespace Illuminate\Auth;
-use Illuminate\Support\Str;
-
class Recaller
{
/**
@@ -71,7 +69,7 @@ public function valid()
*/
protected function properString()
{
- return is_string($this->recaller) && Str::contains($this->recaller, '|');
+ return is_string($this->recaller) && str_contains($this->recaller, '|');
}
/** | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Broadcasting/Broadcasters/AblyBroadcaster.php | @@ -65,7 +65,7 @@ public function auth($request)
*/
public function validAuthenticationResponse($request, $result)
{
- if (Str::startsWith($request->channel_name, 'private')) {
+ if (str_starts_with($request->channel_name, 'private')) {
$signature = $this->generateAblySignature(
$request->channel_name, $request->socket_id
);
@@ -174,7 +174,7 @@ public function isGuardedChannel($channel)
public function normalizeChannelName($channel)
{
if ($this->isGuardedChannel($channel)) {
- return Str::startsWith($channel, 'private-')
+ return str_starts_with($channel, 'private-')
? Str::replaceFirst('private-', '', $channel)
: Str::replaceFirst('presence-', '', $channel);
}
@@ -194,7 +194,7 @@ protected function formatChannels(array $channels)
$channel = (string) $channel;
if (Str::startsWith($channel, ['private-', 'presence-'])) {
- return Str::startsWith($channel, 'private-')
+ return str_starts_with($channel, 'private-')
? Str::replaceFirst('private-', 'private:', $channel)
: Str::replaceFirst('presence-', 'presence:', $channel);
} | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php | @@ -4,7 +4,6 @@
use Illuminate\Broadcasting\BroadcastException;
use Illuminate\Support\Arr;
-use Illuminate\Support\Str;
use Pusher\ApiErrorException;
use Pusher\Pusher;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
@@ -63,7 +62,7 @@ public function auth($request)
*/
public function validAuthenticationResponse($request, $result)
{
- if (Str::startsWith($request->channel_name, 'private')) {
+ if (str_starts_with($request->channel_name, 'private')) {
return $this->decodePusherResponse(
$request, $this->pusher->socket_auth($request->channel_name, $request->socket_id)
); | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Cache/DatabaseStore.php | @@ -371,7 +371,7 @@ protected function serialize($value)
{
$result = serialize($value);
- if ($this->connection instanceof PostgresConnection && Str::contains($result, "\0")) {
+ if ($this->connection instanceof PostgresConnection && str_contains($result, "\0")) {
$result = base64_encode($result);
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Cache/DynamoDbStore.php | @@ -284,7 +284,7 @@ public function add($key, $value, $seconds)
return true;
} catch (DynamoDbException $e) {
- if (Str::contains($e->getMessage(), 'ConditionalCheckFailed')) {
+ if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) {
return false;
}
@@ -329,7 +329,7 @@ public function increment($key, $value = 1)
return (int) $response['Attributes'][$this->valueAttribute]['N'];
} catch (DynamoDbException $e) {
- if (Str::contains($e->getMessage(), 'ConditionalCheckFailed')) {
+ if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) {
return false;
}
@@ -374,7 +374,7 @@ public function decrement($key, $value = 1)
return (int) $response['Attributes'][$this->valueAttribute]['N'];
} catch (DynamoDbException $e) {
- if (Str::contains($e->getMessage(), 'ConditionalCheckFailed')) {
+ if (str_contains($e->getMessage(), 'ConditionalCheckFailed')) {
return false;
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Console/Parser.php | @@ -2,7 +2,6 @@
namespace Illuminate\Console;
-use Illuminate\Support\Str;
use InvalidArgumentException;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
@@ -79,11 +78,11 @@ protected static function parseArgument($token)
[$token, $description] = static::extractDescription($token);
switch (true) {
- case Str::endsWith($token, '?*'):
+ case str_ends_with($token, '?*'):
return new InputArgument(trim($token, '?*'), InputArgument::IS_ARRAY, $description);
- case Str::endsWith($token, '*'):
+ case str_ends_with($token, '*'):
return new InputArgument(trim($token, '*'), InputArgument::IS_ARRAY | InputArgument::REQUIRED, $description);
- case Str::endsWith($token, '?'):
+ case str_ends_with($token, '?'):
return new InputArgument(trim($token, '?'), InputArgument::OPTIONAL, $description);
case preg_match('/(.+)\=\*(.+)/', $token, $matches):
return new InputArgument($matches[1], InputArgument::IS_ARRAY, $description, preg_split('/,\s?/', $matches[2]));
@@ -114,9 +113,9 @@ protected static function parseOption($token)
}
switch (true) {
- case Str::endsWith($token, '='):
+ case str_ends_with($token, '='):
return new InputOption(trim($token, '='), $shortcut, InputOption::VALUE_OPTIONAL, $description);
- case Str::endsWith($token, '=*'):
+ case str_ends_with($token, '=*'):
return new InputOption(trim($token, '=*'), $shortcut, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, $description);
case preg_match('/(.+)\=\*(.+)/', $token, $matches):
return new InputOption($matches[1], $shortcut, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, $description, preg_split('/,\s?/', $matches[2])); | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Console/Scheduling/Schedule.php | @@ -14,7 +14,6 @@
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\CallQueuedClosure;
use Illuminate\Support\ProcessUtils;
-use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use RuntimeException;
@@ -272,11 +271,11 @@ public function compileArrayInput($key, $value)
return ProcessUtils::escapeArgument($value);
});
- if (Str::startsWith($key, '--')) {
+ if (str_starts_with($key, '--')) {
$value = $value->map(function ($value) use ($key) {
return "{$key}={$value}";
});
- } elseif (Str::startsWith($key, '-')) {
+ } elseif (str_starts_with($key, '-')) {
$value = $value->map(function ($value) use ($key) {
return "{$key} {$value}";
}); | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Console/Factories/FactoryMakeCommand.php | @@ -121,7 +121,7 @@ protected function getPath($name)
*/
protected function guessModelName($name)
{
- if (Str::endsWith($name, 'Factory')) {
+ if (str_ends_with($name, 'Factory')) {
$name = substr($name, 0, -7);
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Eloquent/Builder.php | @@ -737,7 +737,7 @@ protected function relationsNestedUnder($relation)
*/
protected function isNestedUnder($relation, $name)
{
- return Str::contains($name, '.') && Str::startsWith($name, $relation.'.');
+ return str_contains($name, '.') && str_starts_with($name, $relation.'.');
}
/**
@@ -1360,7 +1360,7 @@ protected function parseWithRelations(array $relations)
if (is_numeric($name)) {
$name = $constraints;
- [$name, $constraints] = Str::contains($name, ':')
+ [$name, $constraints] = str_contains($name, ':')
? $this->createSelectWithConstraint($name)
: [$name, static function () {
//
@@ -1388,7 +1388,7 @@ protected function createSelectWithConstraint($name)
{
return [explode(':', $name)[0], static function ($query) use ($name) {
$query->select(array_map(static function ($column) use ($query) {
- if (Str::contains($column, '.')) {
+ if (str_contains($column, '.')) {
return $column;
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Eloquent/Collection.php | @@ -7,7 +7,6 @@
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection as BaseCollection;
-use Illuminate\Support\Str;
use LogicException;
/**
@@ -195,7 +194,7 @@ public function loadMissing($relations)
$segments = explode('.', explode(':', $key)[0]);
- if (Str::contains($key, ':')) {
+ if (str_contains($key, ':')) {
$segments[count($segments) - 1] .= ':'.explode(':', $key)[1];
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php | @@ -2,8 +2,6 @@
namespace Illuminate\Database\Eloquent\Concerns;
-use Illuminate\Support\Str;
-
trait GuardsAttributes
{
/**
@@ -188,7 +186,7 @@ public function isFillable($key)
return empty($this->getFillable()) &&
! str_contains($key, '.') &&
- ! Str::startsWith($key, '_');
+ ! str_starts_with($key, '_');
}
/** | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php | @@ -930,7 +930,7 @@ public function setAttribute($key, $value)
// If this attribute contains a JSON ->, we'll set the proper value in the
// attribute's underlying array. This takes care of properly nesting an
// attribute in the array's value in the case of deeply nested items.
- if (Str::contains($key, '->')) {
+ if (str_contains($key, '->')) {
return $this->fillJsonAttribute($key, $value);
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Eloquent/Factories/Factory.php | @@ -810,9 +810,9 @@ public function __call($method, $parameters)
$factory = static::factoryForModel($relatedModel);
}
- if (Str::startsWith($method, 'for')) {
+ if (str_starts_with($method, 'for')) {
return $this->for($factory->state($parameters[0] ?? []), $relationship);
- } elseif (Str::startsWith($method, 'has')) {
+ } elseif (str_starts_with($method, 'has')) {
return $this->has(
$factory
->count(is_numeric($parameters[0] ?? null) ? $parameters[0] : 1) | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Eloquent/Model.php | @@ -461,7 +461,7 @@ public function forceFill(array $attributes)
*/
public function qualifyColumn($column)
{
- if (Str::contains($column, '.')) {
+ if (str_contains($column, '.')) {
return $column;
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php | @@ -164,7 +164,7 @@ public function __construct(Builder $query, Model $parent, $table, $foreignPivot
*/
protected function resolveTableName($table)
{
- if (! Str::contains($table, '\\') || ! class_exists($table)) {
+ if (! str_contains($table, '\\') || ! class_exists($table)) {
return $table;
}
@@ -1445,7 +1445,7 @@ public function getPivotColumns()
*/
public function qualifyPivotColumn($column)
{
- return Str::contains($column, '.')
+ return str_contains($column, '.')
? $column
: $this->table.'.'.$column;
} | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Eloquent/Relations/Concerns/AsPivot.php | @@ -277,7 +277,7 @@ public function newQueryForRestoration($ids)
return $this->newQueryForCollectionRestoration($ids);
}
- if (! Str::contains($ids, ':')) {
+ if (! str_contains($ids, ':')) {
return parent::newQueryForRestoration($ids);
}
@@ -298,7 +298,7 @@ protected function newQueryForCollectionRestoration(array $ids)
{
$ids = array_values($ids);
- if (! Str::contains($ids[0], ':')) {
+ if (! str_contains($ids[0], ':')) {
return parent::newQueryForRestoration($ids);
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Eloquent/Relations/Concerns/CanBeOneOfMany.php | @@ -6,7 +6,6 @@
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Query\JoinClause;
use Illuminate\Support\Arr;
-use Illuminate\Support\Str;
use InvalidArgumentException;
trait CanBeOneOfMany
@@ -276,7 +275,7 @@ public function qualifySubSelectColumn($column)
*/
protected function qualifyRelatedColumn($column)
{
- return Str::contains($column, '.') ? $column : $this->query->getModel()->getTable().'.'.$column;
+ return str_contains($column, '.') ? $column : $this->query->getModel()->getTable().'.'.$column;
}
/** | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Eloquent/Relations/MorphPivot.php | @@ -2,8 +2,6 @@
namespace Illuminate\Database\Eloquent\Relations;
-use Illuminate\Support\Str;
-
class MorphPivot extends Pivot
{
/**
@@ -141,7 +139,7 @@ public function newQueryForRestoration($ids)
return $this->newQueryForCollectionRestoration($ids);
}
- if (! Str::contains($ids, ':')) {
+ if (! str_contains($ids, ':')) {
return parent::newQueryForRestoration($ids);
}
@@ -163,7 +161,7 @@ protected function newQueryForCollectionRestoration(array $ids)
{
$ids = array_values($ids);
- if (! Str::contains($ids[0], ':')) {
+ if (! str_contains($ids[0], ':')) {
return parent::newQueryForRestoration($ids);
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Grammar.php | @@ -3,7 +3,6 @@
namespace Illuminate\Database;
use Illuminate\Database\Query\Expression;
-use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use RuntimeException;
@@ -146,7 +145,7 @@ protected function wrapJsonSelector($value)
*/
protected function isJsonSelector($value)
{
- return Str::contains($value, '->');
+ return str_contains($value, '->');
}
/** | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Migrations/Migrator.php | @@ -506,7 +506,7 @@ protected function getMigrationClass(string $migrationName): string
public function getMigrationFiles($paths)
{
return Collection::make($paths)->flatMap(function ($path) {
- return Str::endsWith($path, '.php') ? [$path] : $this->files->glob($path.'/*_*.php');
+ return str_ends_with($path, '.php') ? [$path] : $this->files->glob($path.'/*_*.php');
})->filter()->values()->keyBy(function ($file) {
return $this->getMigrationName($file);
})->sortBy(function ($file, $key) { | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Query/Builder.php | @@ -759,7 +759,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
// If the column is making a JSON reference we'll check to see if the value
// is a boolean. If it is, we'll add the raw boolean string as an actual
// value to the query to ensure this is properly handled by the query.
- if (Str::contains($column, '->') && is_bool($value)) {
+ if (str_contains($column, '->') && is_bool($value)) {
$value = new Expression($value ? 'true' : 'false');
if (is_string($column)) {
@@ -3592,7 +3592,7 @@ public function __call($method, $parameters)
return $this->macroCall($method, $parameters);
}
- if (Str::startsWith($method, 'where')) {
+ if (str_starts_with($method, 'where')) {
return $this->dynamicWhere($method, $parameters);
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Query/Grammars/PostgresGrammar.php | @@ -4,7 +4,6 @@
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Arr;
-use Illuminate\Support\Str;
class PostgresGrammar extends Grammar
{
@@ -39,7 +38,7 @@ class PostgresGrammar extends Grammar
*/
protected function whereBasic(Builder $query, $where)
{
- if (Str::contains(strtolower($where['operator']), 'like')) {
+ if (str_contains(strtolower($where['operator']), 'like')) {
return sprintf(
'%s::text %s %s',
$this->wrap($where['column']), | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Schema/MySqlSchemaState.php | @@ -149,7 +149,7 @@ protected function executeDumpProcess(Process $process, $output, array $variable
), $output, $variables);
}
- if (Str::contains($e->getMessage(), ['set-gtid-purged'])) {
+ if (str_contains($e->getMessage(), 'set-gtid-purged')) {
return $this->executeDumpProcess(Process::fromShellCommandLine(
str_replace(' --set-gtid-purged=OFF', '', $process->getCommandLine())
), $output, $variables); | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Database/Schema/PostgresSchemaState.php | @@ -3,7 +3,6 @@
namespace Illuminate\Database\Schema;
use Illuminate\Database\Connection;
-use Illuminate\Support\Str;
class PostgresSchemaState extends SchemaState
{
@@ -41,7 +40,7 @@ public function load($path)
{
$command = 'pg_restore --no-owner --no-acl --clean --if-exists --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --username="${:LARAVEL_LOAD_USER}" --dbname="${:LARAVEL_LOAD_DATABASE}" "${:LARAVEL_LOAD_PATH}"';
- if (Str::endsWith($path, '.sql')) {
+ if (str_ends_with($path, '.sql')) {
$command = 'psql --file="${:LARAVEL_LOAD_PATH}" --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --username="${:LARAVEL_LOAD_USER}" --dbname="${:LARAVEL_LOAD_DATABASE}"';
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Events/Dispatcher.php | @@ -91,7 +91,7 @@ public function listen($events, $listener = null)
}
foreach ((array) $events as $event) {
- if (Str::contains($event, '*')) {
+ if (str_contains($event, '*')) {
$this->setupWildcardListen($event, $listener);
} else {
$this->listeners[$event][] = $listener;
@@ -641,7 +641,7 @@ protected function propagateListenerOptions($listener, $job)
*/
public function forget($event)
{
- if (Str::contains($event, '*')) {
+ if (str_contains($event, '*')) {
unset($this->wildcards[$event]);
} else {
unset($this->listeners[$event]);
@@ -662,7 +662,7 @@ public function forget($event)
public function forgetPushed()
{
foreach ($this->listeners as $key => $value) {
- if (Str::endsWith($key, '_pushed')) {
+ if (str_ends_with($key, '_pushed')) {
$this->forget($key);
}
} | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Filesystem/FilesystemAdapter.php | @@ -621,7 +621,7 @@ protected function getLocalUrl($path)
// If the path contains "storage/public", it probably means the developer is using
// the default disk to generate the path instead of the "public" disk like they
// are really supposed to use. We will remove the public from this path here.
- if (Str::contains($path, '/storage/public/')) {
+ if (str_contains($path, '/storage/public/')) {
return Str::replaceFirst('/public/', '/', $path);
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Foundation/Console/EventGenerateCommand.php | @@ -4,7 +4,6 @@
use Illuminate\Console\Command;
use Illuminate\Foundation\Support\Providers\EventServiceProvider;
-use Illuminate\Support\Str;
class EventGenerateCommand extends Command
{
@@ -58,7 +57,7 @@ public function handle()
*/
protected function makeEventAndListeners($event, $listeners)
{
- if (! Str::contains($event, '\\')) {
+ if (! str_contains($event, '\\')) {
return;
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Foundation/Console/EventListCommand.php | @@ -4,7 +4,6 @@
use Closure;
use Illuminate\Console\Command;
-use Illuminate\Support\Str;
use ReflectionFunction;
class EventListCommand extends Command
@@ -122,7 +121,7 @@ protected function filterEvents(array $events)
}
return collect($events)->filter(function ($listeners, $event) use ($eventName) {
- return Str::contains($event, $eventName);
+ return str_contains($event, $eventName);
})->toArray();
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Foundation/Console/PolicyMakeCommand.php | @@ -114,7 +114,7 @@ protected function replaceModel($stub, $model)
{
$model = str_replace('/', '\\', $model);
- if (Str::startsWith($model, '\\')) {
+ if (str_starts_with($model, '\\')) {
$namespacedModel = trim($model, '\\');
} else {
$namespacedModel = $this->qualifyModel($model); | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Foundation/Console/ResourceMakeCommand.php | @@ -3,7 +3,6 @@
namespace Illuminate\Foundation\Console;
use Illuminate\Console\GeneratorCommand;
-use Illuminate\Support\Str;
use Symfony\Component\Console\Input\InputOption;
class ResourceMakeCommand extends GeneratorCommand
@@ -72,7 +71,7 @@ protected function getStub()
protected function collection()
{
return $this->option('collection') ||
- Str::endsWith($this->argument('name'), 'Collection');
+ str_ends_with($this->argument('name'), 'Collection');
}
/** | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Foundation/Console/RouteListCommand.php | @@ -212,15 +212,15 @@ protected function getMiddleware($route)
*/
protected function filterRoute(array $route)
{
- if (($this->option('name') && ! Str::contains($route['name'], $this->option('name'))) ||
- $this->option('path') && ! Str::contains($route['uri'], $this->option('path')) ||
- $this->option('method') && ! Str::contains($route['method'], strtoupper($this->option('method')))) {
+ if (($this->option('name') && ! str_contains($route['name'], $this->option('name'))) ||
+ $this->option('path') && ! str_contains($route['uri'], $this->option('path')) ||
+ $this->option('method') && ! str_contains($route['method'], strtoupper($this->option('method')))) {
return;
}
if ($this->option('except-path')) {
foreach (explode(',', $this->option('except-path')) as $path) {
- if (Str::contains($route['uri'], $path)) {
+ if (str_contains($route['uri'], $path)) {
return;
}
}
@@ -260,7 +260,7 @@ protected function parseColumns(array $columns)
$results = [];
foreach ($columns as $i => $column) {
- if (Str::contains($column, ',')) {
+ if (str_contains($column, ',')) {
$results = array_merge($results, explode(',', $column));
} else {
$results[] = $column; | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Foundation/EnvironmentDetector.php | @@ -3,7 +3,6 @@
namespace Illuminate\Foundation;
use Closure;
-use Illuminate\Support\Str;
class EnvironmentDetector
{
@@ -66,7 +65,7 @@ protected function getEnvironmentArgument(array $args)
return $args[$i + 1] ?? null;
}
- if (Str::startsWith($value, '--env')) {
+ if (str_starts_with($value, '--env')) {
return head(array_slice(explode('=', $value), 1));
}
} | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Foundation/Mix.php | @@ -21,11 +21,11 @@ public function __invoke($path, $manifestDirectory = '')
{
static $manifests = [];
- if (! Str::startsWith($path, '/')) {
+ if (! str_starts_with($path, '/')) {
$path = "/{$path}";
}
- if ($manifestDirectory && ! Str::startsWith($manifestDirectory, '/')) {
+ if ($manifestDirectory && ! str_starts_with($manifestDirectory, '/')) {
$manifestDirectory = "/{$manifestDirectory}";
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php | @@ -5,7 +5,6 @@
use Illuminate\Contracts\Http\Kernel as HttpKernel;
use Illuminate\Cookie\CookieValuePrefix;
use Illuminate\Http\Request;
-use Illuminate\Support\Str;
use Illuminate\Testing\LoggedExceptionCollection;
use Illuminate\Testing\TestResponse;
use Symfony\Component\HttpFoundation\File\UploadedFile as SymfonyUploadedFile;
@@ -527,7 +526,7 @@ public function call($method, $uri, $parameters = [], $cookies = [], $files = []
*/
protected function prepareUrlForRequest($uri)
{
- if (Str::startsWith($uri, '/')) {
+ if (str_starts_with($uri, '/')) {
$uri = substr($uri, 1);
}
@@ -557,7 +556,7 @@ protected function transformHeadersToServerVars(array $headers)
*/
protected function formatServerHeaderKey($name)
{
- if (! Str::startsWith($name, 'HTTP_') && $name !== 'CONTENT_TYPE' && $name !== 'REMOTE_ADDR') {
+ if (! str_starts_with($name, 'HTTP_') && $name !== 'CONTENT_TYPE' && $name !== 'REMOTE_ADDR') {
return 'HTTP_'.$name;
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Http/Client/Request.php | @@ -4,7 +4,6 @@
use ArrayAccess;
use Illuminate\Support\Arr;
-use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use LogicException;
@@ -218,7 +217,7 @@ public function isForm()
public function isJson()
{
return $this->hasHeader('Content-Type') &&
- Str::contains($this->header('Content-Type')[0], 'json');
+ str_contains($this->header('Content-Type')[0], 'json');
}
/**
@@ -229,7 +228,7 @@ public function isJson()
public function isMultipart()
{
return $this->hasHeader('Content-Type') &&
- Str::contains($this->header('Content-Type')[0], 'multipart');
+ str_contains($this->header('Content-Type')[0], 'multipart');
}
/** | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Http/RedirectResponse.php | @@ -249,7 +249,7 @@ public function __call($method, $parameters)
return $this->macroCall($method, $parameters);
}
- if (Str::startsWith($method, 'with')) {
+ if (str_starts_with($method, 'with')) {
return $this->with(Str::snake(substr($method, 4)), $parameters[0]);
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Http/Resources/CollectsResources.php | @@ -49,7 +49,7 @@ protected function collects()
return $this->collects;
}
- if (Str::endsWith(class_basename($this), 'Collection') &&
+ if (str_ends_with(class_basename($this), 'Collection') &&
(class_exists($class = Str::replaceLast('Collection', '', get_class($this))) ||
class_exists($class = Str::replaceLast('Collection', 'Resource', get_class($this))))) {
return $class; | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Log/LogManager.php | @@ -160,7 +160,7 @@ protected function tap($name, Logger $logger)
*/
protected function parseTap($tap)
{
- return Str::contains($tap, ':') ? explode(':', $tap, 2) : [$tap, ''];
+ return str_contains($tap, ':') ? explode(':', $tap, 2) : [$tap, ''];
}
/** | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Mail/Mailable.php | @@ -881,7 +881,7 @@ public function assertSeeInHtml($string)
[$html, $text] = $this->renderForAssertions();
PHPUnit::assertTrue(
- Str::contains($html, $string),
+ str_contains($html, $string),
"Did not see expected text [{$string}] within email body."
);
@@ -899,7 +899,7 @@ public function assertDontSeeInHtml($string)
[$html, $text] = $this->renderForAssertions();
PHPUnit::assertFalse(
- Str::contains($html, $string),
+ str_contains($html, $string),
"Saw unexpected text [{$string}] within email body."
);
@@ -932,7 +932,7 @@ public function assertSeeInText($string)
[$html, $text] = $this->renderForAssertions();
PHPUnit::assertTrue(
- Str::contains($text, $string),
+ str_contains($text, $string),
"Did not see expected text [{$string}] within text email body."
);
@@ -950,7 +950,7 @@ public function assertDontSeeInText($string)
[$html, $text] = $this->renderForAssertions();
PHPUnit::assertFalse(
- Str::contains($text, $string),
+ str_contains($text, $string),
"Saw unexpected text [{$string}] within text email body."
);
@@ -1060,7 +1060,7 @@ public function __call($method, $parameters)
return $this->macroCall($method, $parameters);
}
- if (Str::startsWith($method, 'with')) {
+ if (str_starts_with($method, 'with')) {
return $this->with(Str::camel(substr($method, 4)), $parameters[0]);
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Mail/Markdown.php | @@ -67,7 +67,7 @@ public function render($view, array $data = [], $inliner = null)
if ($this->view->exists($customTheme = Str::start($this->theme, 'mail.'))) {
$theme = $customTheme;
} else {
- $theme = Str::contains($this->theme, '::')
+ $theme = str_contains($this->theme, '::')
? $this->theme
: 'mail::themes.'.$this->theme;
} | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Pagination/AbstractCursorPaginator.php | @@ -111,7 +111,7 @@ public function url($cursor)
}
return $this->path()
- .(Str::contains($this->path(), '?') ? '&' : '?')
+ .(str_contains($this->path(), '?') ? '&' : '?')
.Arr::query($parameters)
.$this->buildFragment();
} | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Pagination/AbstractPaginator.php | @@ -6,7 +6,6 @@
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
-use Illuminate\Support\Str;
use Illuminate\Support\Traits\ForwardsCalls;
use Illuminate\Support\Traits\Tappable;
use Traversable;
@@ -182,7 +181,7 @@ public function url($page)
}
return $this->path()
- .(Str::contains($this->path(), '?') ? '&' : '?')
+ .(str_contains($this->path(), '?') ? '&' : '?')
.Arr::query($parameters)
.$this->buildFragment();
} | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Queue/CallQueuedHandler.php | @@ -13,7 +13,6 @@
use Illuminate\Contracts\Queue\ShouldBeUniqueUntilProcessing;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Pipeline\Pipeline;
-use Illuminate\Support\Str;
use ReflectionClass;
use RuntimeException;
@@ -93,7 +92,7 @@ public function call(Job $job, array $data)
*/
protected function getCommand(array $data)
{
- if (Str::startsWith($data['command'], 'O:')) {
+ if (str_starts_with($data['command'], 'O:')) {
return unserialize($data['command']);
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Queue/Console/RetryCommand.php | @@ -7,7 +7,6 @@
use Illuminate\Contracts\Encryption\Encrypter;
use Illuminate\Queue\Events\JobRetryRequested;
use Illuminate\Support\Arr;
-use Illuminate\Support\Str;
use RuntimeException;
class RetryCommand extends Command
@@ -173,7 +172,7 @@ protected function refreshRetryUntil($payload)
return json_encode($payload);
}
- if (Str::startsWith($payload['data']['command'], 'O:')) {
+ if (str_starts_with($payload['data']['command'], 'O:')) {
$instance = unserialize($payload['data']['command']);
} elseif ($this->laravel->bound(Encrypter::class)) {
$instance = unserialize($this->laravel->make(Encrypter::class)->decrypt($payload['data']['command'])); | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Queue/SqsQueue.php | @@ -201,7 +201,7 @@ public function getQueue($queue)
*/
protected function suffixQueue($queue, $suffix = '')
{
- if (Str::endsWith($queue, '.fifo')) {
+ if (str_ends_with($queue, '.fifo')) {
$queue = Str::beforeLast($queue, '.fifo');
return rtrim($this->prefix, '/').'/'.Str::finish($queue, $suffix).'.fifo'; | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Redis/Connections/PhpRedisConnection.php | @@ -5,7 +5,6 @@
use Closure;
use Illuminate\Contracts\Redis\Connection as ConnectionContract;
use Illuminate\Support\Arr;
-use Illuminate\Support\Str;
use Redis;
use RedisException;
@@ -532,7 +531,7 @@ public function command($method, array $parameters = [])
try {
return parent::command($method, $parameters);
} catch (RedisException $e) {
- if (Str::contains($e->getMessage(), 'went away')) {
+ if (str_contains($e->getMessage(), 'went away')) {
$this->client = $this->connector ? call_user_func($this->connector) : $this->client;
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Routing/AbstractRouteCollection.php | @@ -205,7 +205,7 @@ protected function addToSymfonyRoutesCollection(SymfonyRouteCollection $symfonyR
if (
! is_null($name)
- && Str::endsWith($name, '.')
+ && str_ends_with($name, '.')
&& ! is_null($symfonyRoutes->get($name))
) {
$name = null; | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Routing/Middleware/ThrottleRequests.php | @@ -9,7 +9,6 @@
use Illuminate\Http\Exceptions\ThrottleRequestsException;
use Illuminate\Support\Arr;
use Illuminate\Support\InteractsWithTime;
-use Illuminate\Support\Str;
use RuntimeException;
use Symfony\Component\HttpFoundation\Response;
@@ -146,7 +145,7 @@ protected function handleRequest($request, Closure $next, array $limits)
*/
protected function resolveMaxAttempts($request, $maxAttempts)
{
- if (Str::contains($maxAttempts, '|')) {
+ if (str_contains($maxAttempts, '|')) {
$maxAttempts = explode('|', $maxAttempts, 2)[$request->user() ? 1 : 0];
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Routing/RedirectController.php | @@ -35,7 +35,7 @@ public function __invoke(Request $request, UrlGenerator $url)
$url = $url->toRoute($route, $parameters, false);
- if (! Str::startsWith($destination, '/') && Str::startsWith($url, '/')) {
+ if (! str_starts_with($destination, '/') && str_starts_with($url, '/')) {
$url = Str::after($url, '/');
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Routing/ResourceRegistrar.php | @@ -79,7 +79,7 @@ public function register($name, $controller, array $options = [])
// If the resource name contains a slash, we will assume the developer wishes to
// register these resource routes with a prefix so we will set that up out of
// the box so they don't have to mess with it. Otherwise, we will continue.
- if (Str::contains($name, '/')) {
+ if (str_contains($name, '/')) {
$this->prefixedResource($name, $controller, $options);
return;
@@ -351,7 +351,7 @@ protected function setResourceBindingFields($route, $bindingFields)
*/
public function getResourceUri($resource)
{
- if (! Str::contains($resource, '.')) {
+ if (! str_contains($resource, '.')) {
return $resource;
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Routing/RouteAction.php | @@ -43,7 +43,7 @@ public static function parse($uri, $action)
$action['uses'] = static::findCallable($action);
}
- if (! static::containsSerializedClosure($action) && is_string($action['uses']) && ! Str::contains($action['uses'], '@')) {
+ if (! static::containsSerializedClosure($action) && is_string($action['uses']) && ! str_contains($action['uses'], '@')) {
$action['uses'] = static::makeInvokable($action['uses']);
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Routing/RouteUrlGenerator.php | @@ -4,7 +4,6 @@
use Illuminate\Routing\Exceptions\UrlGenerationException;
use Illuminate\Support\Arr;
-use Illuminate\Support\Str;
class RouteUrlGenerator
{
@@ -200,7 +199,7 @@ protected function replaceRouteParameters($path, array &$parameters)
// Reset only the numeric keys...
$parameters = array_merge($parameters);
- return (! isset($parameters[0]) && ! Str::endsWith($match[0], '?}'))
+ return (! isset($parameters[0]) && ! str_ends_with($match[0], '?}'))
? $match[0]
: Arr::pull($parameters, 0);
}, $path); | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Routing/Router.php | @@ -563,7 +563,7 @@ protected function prependGroupController($class)
return $class;
}
- if (strpos($class, '@') !== false) {
+ if (str_contains($class, '@')) {
return $class;
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Routing/UrlGenerator.php | @@ -283,7 +283,7 @@ protected function removeIndex($root)
{
$i = 'index.php';
- return Str::contains($root, $i) ? str_replace('/'.$i, '', $root) : $root;
+ return str_contains($root, $i) ? str_replace('/'.$i, '', $root) : $root;
}
/**
@@ -568,7 +568,7 @@ public function formatRoot($scheme, $root = null)
$root = $this->cachedRoot;
}
- $start = Str::startsWith($root, 'http://') ? 'http://' : 'https://';
+ $start = str_starts_with($root, 'http://') ? 'http://' : 'https://';
return preg_replace('~'.$start.'~', $scheme, $root, 1);
} | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Support/MessageBag.php | @@ -193,7 +193,7 @@ public function get($key, $format = null)
);
}
- if (Str::contains($key, '*')) {
+ if (str_contains($key, '*')) {
return $this->getMessagesForWildcardKey($key, $format);
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Support/Stringable.php | @@ -510,7 +510,7 @@ public function reverse()
*/
public function repeat(int $times)
{
- return new static(Str::repeat($this->value, $times));
+ return new static(str_repeat($this->value, $times));
}
/**
@@ -522,7 +522,7 @@ public function repeat(int $times)
*/
public function replace($search, $replace)
{
- return new static(Str::replace($search, $replace, $this->value));
+ return new static(str_replace($search, $replace, $this->value));
}
/** | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Translation/MessageSelector.php | @@ -2,8 +2,6 @@
namespace Illuminate\Translation;
-use Illuminate\Support\Str;
-
class MessageSelector
{
/**
@@ -68,7 +66,7 @@ private function extractFromString($part, $number)
$value = $matches[2];
- if (Str::contains($condition, ',')) {
+ if (str_contains($condition, ',')) {
[$from, $to] = explode(',', $condition, 2);
if ($to === '*' && $number >= $from) { | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Validation/Concerns/ValidatesAttributes.php | @@ -890,15 +890,15 @@ protected function getUniqueExtra($parameters)
*/
public function parseTable($table)
{
- [$connection, $table] = Str::contains($table, '.') ? explode('.', $table, 2) : [null, $table];
+ [$connection, $table] = str_contains($table, '.') ? explode('.', $table, 2) : [null, $table];
- if (Str::contains($table, '\\') && class_exists($table) && is_a($table, Model::class, true)) {
+ if (str_contains($table, '\\') && class_exists($table) && is_a($table, Model::class, true)) {
$model = new $table;
$table = $model->getTable();
$connection = $connection ?? $model->getConnectionName();
- if (Str::contains($table, '.') && Str::startsWith($table, $connection)) {
+ if (str_contains($table, '.') && Str::startsWith($table, $connection)) {
$connection = null;
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Validation/DatabasePresenceVerifier.php | @@ -4,7 +4,6 @@
use Closure;
use Illuminate\Database\ConnectionResolverInterface;
-use Illuminate\Support\Str;
class DatabasePresenceVerifier implements DatabasePresenceVerifierInterface
{
@@ -107,7 +106,7 @@ protected function addWhere($query, $key, $extraValue)
$query->whereNull($key);
} elseif ($extraValue === 'NOT_NULL') {
$query->whereNotNull($key);
- } elseif (Str::startsWith($extraValue, '!')) {
+ } elseif (str_starts_with($extraValue, '!')) {
$query->where($key, '!=', mb_substr($extraValue, 1));
} else {
$query->where($key, $extraValue); | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Validation/NotPwnedVerifier.php | @@ -98,7 +98,7 @@ protected function search($hashPrefix)
: '';
return Str::of($body)->trim()->explode("\n")->filter(function ($line) {
- return Str::contains($line, ':');
+ return str_contains($line, ':');
});
}
} | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Validation/Rules/DatabaseRule.php | @@ -5,7 +5,6 @@
use Closure;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Database\Eloquent\Model;
-use Illuminate\Support\Str;
trait DatabaseRule
{
@@ -59,14 +58,14 @@ public function __construct($table, $column = 'NULL')
*/
public function resolveTableName($table)
{
- if (! Str::contains($table, '\\') || ! class_exists($table)) {
+ if (! str_contains($table, '\\') || ! class_exists($table)) {
return $table;
}
if (is_subclass_of($table, Model::class)) {
$model = new $table;
- if (Str::contains($model->getTable(), '.')) {
+ if (str_contains($model->getTable(), '.')) {
return $table;
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Validation/ValidationData.php | @@ -3,7 +3,6 @@
namespace Illuminate\Validation;
use Illuminate\Support\Arr;
-use Illuminate\Support\Str;
class ValidationData
{
@@ -36,7 +35,7 @@ protected static function initializeAttributeOnData($attribute, $masterData)
$data = static::extractDataFromPath($explicitPath, $masterData);
- if (! Str::contains($attribute, '*') || Str::endsWith($attribute, '*')) {
+ if (! str_contains($attribute, '*') || str_ends_with($attribute, '*')) {
return $data;
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Validation/ValidationRuleParser.php | @@ -63,7 +63,7 @@ public function explode($rules)
protected function explodeRules($rules)
{
foreach ($rules as $key => $rule) {
- if (Str::contains($key, '*')) {
+ if (str_contains($key, '*')) {
$rules = $this->explodeWildcardRules($rules, $key, [$rule]);
unset($rules[$key]); | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/Validation/Validator.php | @@ -1148,7 +1148,7 @@ public function sometimes($attribute, $rules, callable $callback)
$this->implicitAttributes = array_merge($response->implicitAttributes, $this->implicitAttributes);
foreach ($response->rules as $ruleKey => $ruleValue) {
- if ($callback($payload, $this->dataForSometimesIteration($ruleKey, ! Str::endsWith($key, '.*')))) {
+ if ($callback($payload, $this->dataForSometimesIteration($ruleKey, ! str_ends_with($key, '.*')))) {
$this->addRules([$ruleKey => $ruleValue]);
}
} | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/View/Compilers/BladeCompiler.php | @@ -478,7 +478,7 @@ protected function compileStatements($value)
*/
protected function compileStatement($match)
{
- if (Str::contains($match[1], '@')) {
+ if (str_contains($match[1], '@')) {
$match[0] = isset($match[3]) ? $match[1].$match[3] : $match[1];
} elseif (isset($this->customDirectives[$match[1]])) {
$match[0] = $this->callCustomDirective($match[1], Arr::get($match, 3));
@@ -500,7 +500,7 @@ protected function callCustomDirective($name, $value)
{
$value = $value ?? '';
- if (Str::startsWith($value, '(') && Str::endsWith($value, ')')) {
+ if (str_starts_with($value, '(') && str_ends_with($value, ')')) {
$value = Str::substr($value, 1, -1);
}
@@ -599,12 +599,12 @@ public function check($name, ...$parameters)
*/
public function component($class, $alias = null, $prefix = '')
{
- if (! is_null($alias) && Str::contains($alias, '\\')) {
+ if (! is_null($alias) && str_contains($alias, '\\')) {
[$class, $alias] = [$alias, $class];
}
if (is_null($alias)) {
- $alias = Str::contains($class, '\\View\\Components\\')
+ $alias = str_contains($class, '\\View\\Components\\')
? collect(explode('\\', Str::after($class, '\\View\\Components\\')))->map(function ($segment) {
return Str::kebab($segment);
})->implode(':') | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/View/Compilers/ComponentTagCompiler.php | @@ -349,7 +349,7 @@ public function guessViewName($name)
$delimiter = ViewFinderInterface::HINT_PATH_DELIMITER;
- if (Str::contains($name, $delimiter)) {
+ if (str_contains($name, $delimiter)) {
return Str::replaceFirst($delimiter, $delimiter.$prefix, $name);
}
@@ -498,15 +498,15 @@ protected function getAttributesFromAttributeString(string $attributeString)
$value = $this->stripQuotes($value);
- if (Str::startsWith($attribute, 'bind:')) {
+ if (str_starts_with($attribute, 'bind:')) {
$attribute = Str::after($attribute, 'bind:');
$this->boundAttributes[$attribute] = true;
} else {
$value = "'".$this->compileAttributeEchos($value)."'";
}
- if (Str::startsWith($attribute, '::')) {
+ if (str_starts_with($attribute, '::')) {
$attribute = substr($attribute, 1);
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/View/Compilers/Concerns/CompilesEchos.php | @@ -143,7 +143,7 @@ protected function wrapInEchoHandler($value)
{
$value = Str::of($value)
->trim()
- ->when(Str::endsWith($value, ';'), function ($str) {
+ ->when(str_ends_with($value, ';'), function ($str) {
return $str->beforeLast(';');
});
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/View/Component.php | @@ -6,7 +6,6 @@
use Illuminate\Container\Container;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Contracts\View\View as ViewContract;
-use Illuminate\Support\Str;
use ReflectionClass;
use ReflectionMethod;
use ReflectionProperty;
@@ -223,7 +222,7 @@ protected function createInvokableVariable(string $method)
*/
protected function shouldIgnore($name)
{
- return Str::startsWith($name, '__') ||
+ return str_starts_with($name, '__') ||
in_array($name, $this->ignoredMethods());
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/View/Concerns/ManagesEvents.php | @@ -145,7 +145,7 @@ protected function parseClassEvent($class, $prefix)
*/
protected function classEventMethodForPrefix($prefix)
{
- return Str::contains($prefix, 'composing') ? 'compose' : 'create';
+ return str_contains($prefix, 'composing') ? 'compose' : 'create';
}
/**
@@ -157,7 +157,7 @@ protected function classEventMethodForPrefix($prefix)
*/
protected function addEventListener($name, $callback)
{
- if (Str::contains($name, '*')) {
+ if (str_contains($name, '*')) {
$callback = function ($name, array $data) use ($callback) {
return $callback($data[0]);
}; | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/View/Factory.php | @@ -7,7 +7,6 @@
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\View\Factory as FactoryContract;
use Illuminate\Support\Arr;
-use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use Illuminate\View\Engines\EngineResolver;
use InvalidArgumentException;
@@ -231,7 +230,7 @@ public function renderEach($view, $data, $iterator, $empty = 'raw|')
// view. Alternatively, the "empty view" could be a raw string that begins
// with "raw|" for convenience and to let this know that it is a string.
else {
- $result = Str::startsWith($empty, 'raw|')
+ $result = str_starts_with($empty, 'raw|')
? substr($empty, 4)
: $this->make($empty)->render();
}
@@ -321,7 +320,7 @@ protected function getExtension($path)
$extensions = array_keys($this->extensions);
return Arr::first($extensions, function ($value) use ($path) {
- return Str::endsWith($path, '.'.$value);
+ return str_ends_with($path, '.'.$value);
});
}
| true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | src/Illuminate/View/View.php | @@ -405,7 +405,7 @@ public function __call($method, $parameters)
return $this->macroCall($method, $parameters);
}
- if (! Str::startsWith($method, 'with')) {
+ if (! str_starts_with($method, 'with')) {
throw new BadMethodCallException(sprintf(
'Method %s::%s does not exist.', static::class, $method
)); | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | tests/Database/DatabaseMigratorIntegrationTest.php | @@ -9,7 +9,6 @@
use Illuminate\Database\Migrations\Migrator;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Facade;
-use Illuminate\Support\Str;
use Mockery as m;
use PHPUnit\Framework\TestCase;
@@ -83,8 +82,8 @@ public function testBasicMigrationOfSingleFolder()
$this->assertTrue($this->db->schema()->hasTable('users'));
$this->assertTrue($this->db->schema()->hasTable('password_resets'));
- $this->assertTrue(Str::contains($ran[0], 'users'));
- $this->assertTrue(Str::contains($ran[1], 'password_resets'));
+ $this->assertTrue(str_contains($ran[0], 'users'));
+ $this->assertTrue(str_contains($ran[1], 'password_resets'));
}
public function testMigrationsCanBeRolledBack()
@@ -96,8 +95,8 @@ public function testMigrationsCanBeRolledBack()
$this->assertFalse($this->db->schema()->hasTable('users'));
$this->assertFalse($this->db->schema()->hasTable('password_resets'));
- $this->assertTrue(Str::contains($rolledBack[0], 'password_resets'));
- $this->assertTrue(Str::contains($rolledBack[1], 'users'));
+ $this->assertTrue(str_contains($rolledBack[0], 'password_resets'));
+ $this->assertTrue(str_contains($rolledBack[1], 'users'));
}
public function testMigrationsCanBeReset()
@@ -109,8 +108,8 @@ public function testMigrationsCanBeReset()
$this->assertFalse($this->db->schema()->hasTable('users'));
$this->assertFalse($this->db->schema()->hasTable('password_resets'));
- $this->assertTrue(Str::contains($rolledBack[0], 'password_resets'));
- $this->assertTrue(Str::contains($rolledBack[1], 'users'));
+ $this->assertTrue(str_contains($rolledBack[0], 'password_resets'));
+ $this->assertTrue(str_contains($rolledBack[1], 'users'));
}
public function testNoErrorIsThrownWhenNoOutstandingMigrationsExist() | true |
Other | laravel | framework | f64cfa3f2ee711606723e6018e343eb2c39368cb.json | Fix conflict (#40619) | tests/Foundation/Http/Middleware/TransformsRequestTest.php | @@ -4,7 +4,6 @@
use Illuminate\Foundation\Http\Middleware\TransformsRequest;
use Illuminate\Http\Request;
-use Illuminate\Support\Str;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
@@ -114,11 +113,11 @@ class ManipulateArrayInput extends TransformsRequest
{
protected function transform($key, $value)
{
- if (Str::contains($key, 'beers')) {
+ if (str_contains($key, 'beers')) {
$value++;
}
- if (Str::contains($key, 'age')) {
+ if (str_contains($key, 'age')) {
$value--;
}
| true |
Other | laravel | framework | d2b4cfb3873134d04f1e89995475f4c6b38dbac4.json | fix typo on pull request template (#40648) | .github/PULL_REQUEST_TEMPLATE.md | @@ -1,5 +1,5 @@
<!--
-Please only send a pull request to branches which are currently supported: https://laravel.com/docs/releases#support-policy
+Please only send a pull request to branches that are currently supported: https://laravel.com/docs/releases#support-policy
If you are unsure which branch your pull request should be sent to, please read: https://laravel.com/docs/contributions#which-branch
| false |
Other | laravel | framework | af03b0d634c9341d2ff8f3c92160fdf37428f4dc.json | Add support for nested having in queries | src/Illuminate/Database/Query/Builder.php | @@ -1550,6 +1550,33 @@ public function addNestedWhereQuery($query, $boolean = 'and')
return $this;
}
+ public function havingNested(Closure $callback, $boolean = 'and')
+ {
+ call_user_func($callback, $query = $this->forNestedWhere());
+
+ return $this->addNestedHavingQuery($query, $boolean);
+ }
+
+ /**
+ * Add another query builder as a nested where to the query builder.
+ *
+ * @param \Illuminate\Database\Query\Builder $query
+ * @param string $boolean
+ * @return $this
+ */
+ public function addNestedHavingQuery($query, $boolean = 'and')
+ {
+ if (count($query->havings)) {
+ $type = 'Nested';
+
+ $this->havings[] = compact('type', 'query', 'boolean');
+
+ $this->addBinding($query->getRawBindings()['having'], 'having');
+ }
+
+ return $this;
+ }
+
/**
* Add a full sub-select to the query.
*
@@ -1924,7 +1951,7 @@ public function groupByRaw($sql, array $bindings = [])
/**
* Add a "having" clause to the query.
*
- * @param string $column
+ * @param \Closure|string $column
* @param string|null $operator
* @param string|null $value
* @param string $boolean
@@ -1941,6 +1968,13 @@ public function having($column, $operator = null, $value = null, $boolean = 'and
$value, $operator, func_num_args() === 2
);
+ // If the columns is actually a Closure instance, we will assume the developer
+ // wants to begin a nested having statement which is wrapped in parenthesis.
+ // We'll add that Closure to the query then return back out immediately.
+ if ($column instanceof Closure && is_null($operator)) {
+ return $this->havingNested($column, $boolean);
+ }
+
// If the given operator is not found in the list of valid operators we will
// assume that the developer is just short-cutting the '=' operators and
// we will set the operators to '=' and set the values appropriately.
@@ -1964,7 +1998,7 @@ public function having($column, $operator = null, $value = null, $boolean = 'and
/**
* Add an "or having" clause to the query.
*
- * @param string $column
+ * @param \Closure|string $column
* @param string|null $operator
* @param string|null $value
* @return $this | true |
Other | laravel | framework | af03b0d634c9341d2ff8f3c92160fdf37428f4dc.json | Add support for nested having in queries | src/Illuminate/Database/Query/Grammars/Grammar.php | @@ -686,16 +686,19 @@ protected function compileGroups(Builder $query, $groups)
* @param array $havings
* @return string
*/
- protected function compileHavings(Builder $query, $havings)
+ protected function compileHavings(Builder $query)
{
- $sql = implode(' ', array_map([$this, 'compileHaving'], $havings));
+ $sql = collect($query->havings)->map(function ($having) {
+ return $having['boolean'].' '.$this->compileHaving($having);
+ })->implode(' ');
return 'having '.$this->removeLeadingBoolean($sql);
}
/**
* Compile a single having clause.
*
+ * @param \Illuminate\Database\Query\Builder $query
* @param array $having
* @return string
*/
@@ -705,7 +708,7 @@ protected function compileHaving(array $having)
// without doing any more processing on it. Otherwise, we will compile the
// clause into SQL based on the components that make it up from builder.
if ($having['type'] === 'Raw') {
- return $having['boolean'].' '.$having['sql'];
+ return $having['sql'];
} elseif ($having['type'] === 'between') {
return $this->compileHavingBetween($having);
} elseif ($having['type'] === 'Null') {
@@ -714,11 +717,24 @@ protected function compileHaving(array $having)
return $this->compileHavingNotNull($having);
} elseif ($having['type'] === 'bit') {
return $this->compileHavingBit($having);
+ } elseif ($having['type'] === 'Nested') {
+ return $this->compileNestedHavings($having);
}
return $this->compileBasicHaving($having);
}
+ /**
+ * Compile a nested having clause.
+ *
+ * @param array $having
+ * @return string
+ */
+ protected function compileNestedHavings($having)
+ {
+ return '('.substr($this->compileHavings($having['query']), 7).')';
+ }
+
/**
* Compile a basic having clause.
*
@@ -731,7 +747,7 @@ protected function compileBasicHaving($having)
$parameter = $this->parameter($having['value']);
- return $having['boolean'].' '.$column.' '.$having['operator'].' '.$parameter;
+ return $column.' '.$having['operator'].' '.$parameter;
}
/**
@@ -750,7 +766,7 @@ protected function compileHavingBetween($having)
$max = $this->parameter(last($having['values']));
- return $having['boolean'].' '.$column.' '.$between.' '.$min.' and '.$max;
+ return $column.' '.$between.' '.$min.' and '.$max;
}
/**
@@ -763,7 +779,7 @@ protected function compileHavingNull($having)
{
$column = $this->wrap($having['column']);
- return $having['boolean'].' '.$column.' is null';
+ return $column.' is null';
}
/**
@@ -776,7 +792,7 @@ protected function compileHavingNotNull($having)
{
$column = $this->wrap($having['column']);
- return $having['boolean'].' '.$column.' is not null';
+ return $column.' is not null';
}
/**
@@ -791,7 +807,7 @@ protected function compileHavingBit($having)
$parameter = $this->parameter($having['value']);
- return $having['boolean'].' ('.$column.' '.$having['operator'].' '.$parameter.') != 0';
+ return '('.$column.' '.$having['operator'].' '.$parameter.') != 0';
}
/** | true |
Other | laravel | framework | af03b0d634c9341d2ff8f3c92160fdf37428f4dc.json | Add support for nested having in queries | tests/Database/DatabaseQueryBuilderTest.php | @@ -1392,6 +1392,25 @@ public function testHavings()
$this->assertSame('select "category", count(*) as "total" from "item" where "department" = ? group by "category" having "total" > ?', $builder->toSql());
}
+ public function testNestedHavings()
+ {
+ $builder = $this->getBuilder();
+ $builder->select('*')->from('users')->having('email', '=', 'foo')->orHaving(function ($q) {
+ $q->having('name', '=', 'bar')->having('age', '=', 25);
+ });
+ $this->assertSame('select * from "users" having "email" = ? or ("name" = ? and "age" = ?)', $builder->toSql());
+ $this->assertEquals([0 => 'foo', 1 => 'bar', 2 => 25], $builder->getBindings());
+ }
+
+ public function testNestedHavingBindings()
+ {
+ $builder = $this->getBuilder();
+ $builder->having('email', '=', 'foo')->having(function ($q) {
+ $q->selectRaw('?', ['ignore'])->having('name', '=', 'bar');
+ });
+ $this->assertEquals([0 => 'foo', 1 => 'bar'], $builder->getBindings());
+ }
+
public function testHavingBetweens()
{
$builder = $this->getBuilder(); | true |
Other | laravel | framework | 01fa44a345c8df3624a633a2cc2738083f275241.json | Update Collection.php (#40627) | src/Illuminate/Collections/Collection.php | @@ -363,7 +363,7 @@ public function except($keys)
/**
* Run a filter over each of the items.
*
- * @param (callable(TValue): bool)|null $callback
+ * @param (callable(TValue, TKey): bool)|null $callback
* @return static
*/
public function filter(callable $callback = null) | false |
Other | laravel | framework | 74651006bfc19622d8aa93c8f827c1ff4bd364c4.json | Use proper assertions (#40622) | tests/Database/DatabaseEloquentBelongsToManySyncTouchesParentTest.php | @@ -88,7 +88,7 @@ public function testSyncWithDetachedValuesShouldTouch()
Carbon::setTestNow('2021-07-20 19:13:14');
$result = $article->users()->sync([1, 2]);
- $this->assertTrue(collect($result['detached'])->count() === 1);
+ $this->assertCount(1, collect($result['detached']));
$this->assertSame('3', collect($result['detached'])->first());
$article->refresh(); | true |
Other | laravel | framework | 74651006bfc19622d8aa93c8f827c1ff4bd364c4.json | Use proper assertions (#40622) | tests/Database/DatabaseSchemaBlueprintIntegrationTest.php | @@ -86,7 +86,7 @@ public function testRenamingAndChangingColumnsWork()
],
];
- $this->assertTrue(in_array($queries, $expected));
+ $this->assertContains($queries, $expected);
}
public function testChangingColumnWithCollationWorks() | true |
Other | laravel | framework | 74651006bfc19622d8aa93c8f827c1ff4bd364c4.json | Use proper assertions (#40622) | tests/Integration/Database/DatabaseEloquentModelAttributeCastingTest.php | @@ -188,7 +188,7 @@ public function testCastsThatOnlyHaveGetterDoNotPeristAnythingToModelOnSave()
$model->getAttributes();
- $this->assertTrue(empty($model->getDirty()));
+ $this->assertEmpty($model->getDirty());
}
public function testCastsThatOnlyHaveGetterThatReturnsPrimitivesAreNotCached() | true |
Other | laravel | framework | 74651006bfc19622d8aa93c8f827c1ff4bd364c4.json | Use proper assertions (#40622) | tests/Integration/Database/EloquentModelCustomCastingTest.php | @@ -72,8 +72,8 @@ public function testSavingCastedAttributesToDatabase()
$this->assertSame('address_line_two_value', $model->getOriginal('address_line_two'));
$this->assertSame('address_line_two_value', $model->getAttribute('address_line_two'));
- $this->assertSame(null, $model->getOriginal('string_field'));
- $this->assertSame(null, $model->getAttribute('string_field'));
+ $this->assertNull($model->getOriginal('string_field'));
+ $this->assertNull($model->getAttribute('string_field'));
$this->assertSame('', $model->getRawOriginal('string_field'));
/** @var \Illuminate\Tests\Integration\Database\CustomCasts $another_model */ | true |
Other | laravel | framework | 74651006bfc19622d8aa93c8f827c1ff4bd364c4.json | Use proper assertions (#40622) | tests/Session/SessionStoreTest.php | @@ -241,7 +241,7 @@ public function testOldInputFlashing()
$this->assertFalse($session->hasOldInput('boom'));
$this->assertSame('default', $session->getOldInput('input', 'default'));
- $this->assertSame(null, $session->getOldInput('name', 'default'));
+ $this->assertNull($session->getOldInput('name', 'default'));
}
public function testDataFlashing() | true |
Other | laravel | framework | 74651006bfc19622d8aa93c8f827c1ff4bd364c4.json | Use proper assertions (#40622) | tests/View/Blade/BladeComponentTagCompilerTest.php | @@ -423,7 +423,7 @@ public function testAttributesTreatedAsPropsAreRemovedFromFinalAttributes()
eval(" ?> $template <?php ");
ob_get_clean();
- $this->assertSame($attributes->get('userId'), null);
+ $this->assertNull($attributes->get('userId'));
$this->assertSame($attributes->get('other'), 'ok');
}
| true |
Other | laravel | framework | 74651006bfc19622d8aa93c8f827c1ff4bd364c4.json | Use proper assertions (#40622) | tests/View/Blade/BladePropsTest.php | @@ -36,11 +36,11 @@ public function testPropsAreExtractedFromParentAttributesCorrectly()
$this->assertSame($test1, 'value1');
$this->assertSame($test2, 'value2');
- $this->assertSame(isset($test3), false);
+ $this->assertFalse(isset($test3));
$this->assertSame($test4, 'default');
- $this->assertSame($attributes->get('test1'), null);
- $this->assertSame($attributes->get('test2'), null);
+ $this->assertNull($attributes->get('test1'));
+ $this->assertNull($attributes->get('test2'));
$this->assertSame($attributes->get('test3'), 'value3');
}
} | true |
Other | laravel | framework | 97d89f99cc46f7aa037e82bcbae597fb16ac41c4.json | Update release.sh (#40608) | bin/release.sh | @@ -52,7 +52,7 @@ git tag $VERSION
git push origin --tags
# Tag Components
-for REMOTE in auth broadcasting bus cache collections config console container contracts cookie database encryption events filesystem hashing http log macroable mail notifications pagination pipeline queue redis routing session support testing translation validation view
+for REMOTE in auth broadcasting bus cache collections conditionable config console container contracts cookie database encryption events filesystem hashing http log macroable mail notifications pagination pipeline queue redis routing session support testing translation validation view
do
echo ""
echo "" | false |
Other | laravel | framework | 9b4f011fb95c70444812f61d46c8e21fb5b66dd9.json | Remove useless reduceWithKeys method (#40566) | src/Illuminate/Collections/Traits/EnumeratesValues.php | @@ -785,21 +785,6 @@ class_basename(static::class), gettype($result)
return $result;
}
- /**
- * Reduce an associative collection to a single value.
- *
- * @template TReduceWithKeysInitial
- * @template TReduceWithKeysReturnType
- *
- * @param callable(TReduceWithKeysInitial|TReduceWithKeysReturnType, TValue): TReduceWithKeysReturnType $callback
- * @param TReduceWithKeysInitial $initial
- * @return TReduceWithKeysReturnType
- */
- public function reduceWithKeys(callable $callback, $initial = null)
- {
- return $this->reduce($callback, $initial);
- }
-
/**
* Create a collection of all elements that do not pass a given truth test.
* | true |
Other | laravel | framework | 9b4f011fb95c70444812f61d46c8e21fb5b66dd9.json | Remove useless reduceWithKeys method (#40566) | tests/Support/SupportCollectionTest.php | @@ -3963,20 +3963,6 @@ public function testReduce($collection)
}));
}
- /**
- * @dataProvider collectionClassProvider
- */
- public function testReduceWithKeys($collection)
- {
- $data = new $collection([
- 'foo' => 'bar',
- 'baz' => 'qux',
- ]);
- $this->assertSame('foobarbazqux', $data->reduceWithKeys(function ($carry, $element, $key) {
- return $carry .= $key.$element;
- }));
- }
-
/**
* @dataProvider collectionClassProvider
*/ | true |
Other | laravel | framework | 9b4f011fb95c70444812f61d46c8e21fb5b66dd9.json | Remove useless reduceWithKeys method (#40566) | types/Support/Collection.php | @@ -547,21 +547,6 @@
return 1;
}, 0));
-assertType('int', $collection
- ->reduceWithKeys(function ($null, $user) {
- assertType('User', $user);
- assertType('int|null', $null);
-
- return 1;
- }));
-assertType('int', $collection
- ->reduceWithKeys(function ($int, $user) {
- assertType('User', $user);
- assertType('int', $int);
-
- return 1;
- }, 0));
-
assertType('Illuminate\Support\Collection<int, int>', $collection::make([1])->replace([1]));
assertType('Illuminate\Support\Collection<int, User>', $collection->replace([new User]));
| true |
Other | laravel | framework | 9b4f011fb95c70444812f61d46c8e21fb5b66dd9.json | Remove useless reduceWithKeys method (#40566) | types/Support/LazyCollection.php | @@ -546,21 +546,6 @@
return 1;
}, 0));
-assertType('int', $collection
- ->reduceWithKeys(function ($null, $user) {
- assertType('User', $user);
- assertType('int|null', $null);
-
- return 1;
- }));
-assertType('int', $collection
- ->reduceWithKeys(function ($int, $user) {
- assertType('User', $user);
- assertType('int', $int);
-
- return 1;
- }, 0));
-
assertType('Illuminate\Support\LazyCollection<int, int>', $collection::make([1])->replace([1]));
assertType('Illuminate\Support\LazyCollection<int, User>', $collection->replace([new User]));
| true |
Other | laravel | framework | 02365bb5ebafeeaef28b5eb659466c56b2634c65.json | Remove deprecated `reduceMany` method (#40565) | src/Illuminate/Collections/Traits/EnumeratesValues.php | @@ -758,22 +758,6 @@ public function reduce(callable $callback, $initial = null)
return $result;
}
- /**
- * Reduce the collection to multiple aggregate values.
- *
- * @param callable $callback
- * @param mixed ...$initial
- * @return array
- *
- * @deprecated Use "reduceSpread" instead
- *
- * @throws \UnexpectedValueException
- */
- public function reduceMany(callable $callback, ...$initial)
- {
- return $this->reduceSpread($callback, ...$initial);
- }
-
/**
* Reduce the collection to multiple aggregate values.
* | false |
Other | laravel | framework | 7880ba75248c849e3137ae9832ec2220ca62d6c6.json | Fix many docblocks (#40589) | src/Illuminate/Auth/DatabaseUserProvider.php | @@ -36,7 +36,7 @@ class DatabaseUserProvider implements UserProvider
/**
* Create a new database user provider.
*
- * @param \Illuminate\Database\ConnectionInterface $conn
+ * @param \Illuminate\Database\ConnectionInterface $connection
* @param \Illuminate\Contracts\Hashing\Hasher $hasher
* @param string $table
* @return void | true |
Other | laravel | framework | 7880ba75248c849e3137ae9832ec2220ca62d6c6.json | Fix many docblocks (#40589) | src/Illuminate/Collections/Traits/EnumeratesValues.php | @@ -583,7 +583,6 @@ public function whereNotNull($key = null)
*
* @param string $key
* @param mixed $value
- * @param bool $strict
* @return static
*/
public function whereStrict($key, $value) | true |
Other | laravel | framework | 7880ba75248c849e3137ae9832ec2220ca62d6c6.json | Fix many docblocks (#40589) | src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php | @@ -462,11 +462,11 @@ public function orWhereMorphedTo($relation, $model)
* Add a "belongs to" relationship where clause to the query.
*
* @param \Illuminate\Database\Eloquent\Model $related
- * @param string $relationship
+ * @param string|null $relationshipName
* @param string $boolean
* @return $this
*
- * @throws \RuntimeException
+ * @throws \Illuminate\Database\Eloquent\RelationNotFoundException
*/
public function whereBelongsTo($related, $relationshipName = null, $boolean = 'and')
{
@@ -498,7 +498,7 @@ public function whereBelongsTo($related, $relationshipName = null, $boolean = 'a
* Add an "BelongsTo" relationship with an "or where" clause to the query.
*
* @param \Illuminate\Database\Eloquent\Model $related
- * @param string $relationship
+ * @param string|null $relationshipName
* @return $this
*
* @throws \RuntimeException | true |
Other | laravel | framework | 7880ba75248c849e3137ae9832ec2220ca62d6c6.json | Fix many docblocks (#40589) | src/Illuminate/Database/Eloquent/Relations/Concerns/CanBeOneOfMany.php | @@ -52,7 +52,7 @@ abstract public function getOneOfManySubQuerySelectColumns();
/**
* Add join query constraints for one of many relationships.
*
- * @param \Illuminate\Database\Eloquent\JoinClause $join
+ * @param \Illuminate\Database\Query\JoinClause $join
* @return void
*/
abstract public function addOneOfManyJoinSubQueryConstraints(JoinClause $join);
@@ -137,7 +137,6 @@ public function ofMany($column = 'id', $aggregate = 'MAX', $relation = null)
* Indicate that the relation is the latest single result of a larger one-to-many relationship.
*
* @param string|array|null $column
- * @param string|Closure|null $aggregate
* @param string|null $relation
* @return $this
*/
@@ -152,7 +151,6 @@ public function latestOfMany($column = 'id', $relation = null)
* Indicate that the relation is the oldest single result of a larger one-to-many relationship.
*
* @param string|array|null $column
- * @param string|Closure|null $aggregate
* @param string|null $relation
* @return $this
*/
@@ -227,7 +225,7 @@ protected function addOneOfManyJoinSubQuery(Builder $parent, Builder $subQuery,
/**
* Merge the relationship query joins to the given query builder.
*
- * @param \Illuminate\Database\Eloquent\Builder $builder
+ * @param \Illuminate\Database\Eloquent\Builder $query
* @return void
*/
protected function mergeOneOfManyJoinsTo(Builder $query) | true |
Other | laravel | framework | 7880ba75248c849e3137ae9832ec2220ca62d6c6.json | Fix many docblocks (#40589) | src/Illuminate/Database/Eloquent/Relations/HasOne.php | @@ -103,7 +103,7 @@ public function getOneOfManySubQuerySelectColumns()
/**
* Add join query constraints for one of many relationships.
*
- * @param \Illuminate\Database\Eloquent\JoinClause $join
+ * @param \Illuminate\Database\Query\JoinClause $join
* @return void
*/
public function addOneOfManyJoinSubQueryConstraints(JoinClause $join) | true |
Other | laravel | framework | 7880ba75248c849e3137ae9832ec2220ca62d6c6.json | Fix many docblocks (#40589) | src/Illuminate/Database/Eloquent/Relations/MorphOne.php | @@ -101,7 +101,7 @@ public function getOneOfManySubQuerySelectColumns()
/**
* Add join query constraints for one of many relationships.
*
- * @param \Illuminate\Database\Eloquent\JoinClause $join
+ * @param \Illuminate\Database\Query\JoinClause $join
* @return void
*/
public function addOneOfManyJoinSubQueryConstraints(JoinClause $join) | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.