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 | 8766d9909007bdb318f390a1d157898bd56b8082.json | Add support for newQueryForRestoration from queues | src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php | @@ -48,10 +48,12 @@ protected function getRestoredPropertyValue($value)
return $value;
}
+ $model = (new $value->class)->setConnection($value->connection);
+
return is_array($value->id)
- ? $this->restoreCollection($value)
- : $this->getQueryForModelRestoration((new $value->class)->setConnection($value->connection))
- ->useWritePdo()->findOrFail($value->id);
+ ? $this->restoreCollection($value)
+ : $this->getQueryForModelRestoration($model, $value->id)
+ ->useWritePdo()->firstOrFail();
}
/**
@@ -68,18 +70,19 @@ protected function restoreCollection($value)
$model = (new $value->class)->setConnection($value->connection);
- return $this->getQueryForModelRestoration($model)->useWritePdo()
- ->whereIn($model->getQualifiedKeyName(), $value->id)->get();
+ return $this->getQueryForModelRestoration($model, $value->id)
+ ->useWritePdo()->get();
}
/**
* Get the query for restoration.
*
* @param \Illuminate\Database\Eloquent\Model $model
+ * @param array|int $ids
* @return \Illuminate\Database\Eloquent\Builder
*/
- protected function getQueryForModelRestoration($model)
+ protected function getQueryForModelRestoration($model, $ids)
{
- return $model->newQueryWithoutScopes();
+ return $model->newQueryForRestoration($ids);
}
} | true |
Other | laravel | framework | 7a322477934115b86dbd73953d15e61a929246f9.json | Support custom URLs for AWS storage | src/Illuminate/Filesystem/FilesystemAdapter.php | @@ -350,6 +350,15 @@ public function url($path)
*/
protected function getAwsUrl($adapter, $path)
{
+ $config = $this->driver->getConfig();
+
+ // If an explicit base URL has been set on the disk configuration then we will use
+ // it as the base URL instead of the default path. This allows the developer to
+ // have full control over the base path for this filesystem's generated URLs.
+ if (! is_null($url = $config->get('url'))) {
+ return $this->concatPathToUrl($url, $path);
+ }
+
return $adapter->getClient()->getObjectUrl(
$adapter->getBucket(), $adapter->getPathPrefix().$path
);
@@ -381,7 +390,7 @@ protected function getLocalUrl($path)
// it as the base URL instead of the default path. This allows the developer to
// have full control over the base path for this filesystem's generated URLs.
if ($config->has('url')) {
- return rtrim($config->get('url'), '/').'/'.ltrim($path, '/');
+ return $this->concatPathToUrl($config->get('url'), $path);
}
$path = '/storage/'.$path;
@@ -460,6 +469,18 @@ public function getRackspaceTemporaryUrl($adapter, $path, $expiration, $options)
);
}
+ /**
+ * Concatenate a path to a URL.
+ *
+ * @param string $url
+ * @param string $path
+ * @return string
+ */
+ protected function concatPathToUrl($url, $path)
+ {
+ return rtrim($url, '/').'/'.ltrim($path, '/');
+ }
+
/**
* Get an array of all files in a directory.
* | false |
Other | laravel | framework | da3b7081206266e7baa071676b50b354a374029e.json | remove message assertions | tests/Integration/Support/ManagerTest.php | @@ -8,7 +8,6 @@ class ManagerTest extends TestCase
{
/**
* @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Unable to resolve NULL driver for Illuminate\Tests\Integration\Support\Fixtures\NullableManager
*/
public function testDefaultDriverCannotBeNull()
{ | false |
Other | laravel | framework | 06f564717eb074242bff8b7bce34fd86e95f5cd6.json | Apply fixes from StyleCI (#22031) | src/Illuminate/Support/Manager.php | @@ -57,7 +57,7 @@ public function driver($driver = null)
$driver = $driver ?: $this->getDefaultDriver();
if (is_null($driver)) {
- throw new InvalidArgumentException("Unable to resolve NULL driver for [".get_class($this)."].");
+ throw new InvalidArgumentException('Unable to resolve NULL driver for ['.get_class($this).'].');
}
// If the given driver has not been created before, we will create the instances | false |
Other | laravel | framework | 27bb66632aa805a88474e4f8694864a6c7d4a5d6.json | Apply fixes from StyleCI (#22006) | src/Illuminate/Routing/Controller.php | @@ -65,6 +65,6 @@ public function callAction($method, $parameters)
*/
public function __call($method, $parameters)
{
- throw new BadMethodCallException("Method [{$method}] does not exist on [".get_class($this)."].");
+ throw new BadMethodCallException("Method [{$method}] does not exist on [".get_class($this).'].');
}
} | false |
Other | laravel | framework | b4d384028a5531cb9253075e6ddfb951ae0adac9.json | detect connection lost for pgbouncer (#21988) | src/Illuminate/Database/DetectsLostConnections.php | @@ -30,6 +30,7 @@ protected function causedByLostConnection(Exception $e)
'Resource deadlock avoided',
'Transaction() on null',
'child connection forced to terminate due to client_idle_limit',
+ 'query_wait_timeout',
]);
}
} | false |
Other | laravel | framework | 72da6a524a4514914031c367f112facbbeb0f73a.json | Apply fixes from StyleCI (#21972) | src/Illuminate/Hashing/ArgonHasher.php | @@ -40,7 +40,7 @@ public function make($value, array $options = [])
$hash = password_hash($value, PASSWORD_ARGON2I, [
'memory_cost' => $this->memory($options),
'time_cost' => $this->time($options),
- 'threads' => $this->processors($options)
+ 'threads' => $this->processors($options),
]);
if ($hash === false) {
@@ -79,7 +79,7 @@ public function needsRehash($hashedValue, array $options = [])
return password_needs_rehash($hashedValue, PASSWORD_ARGON2I, [
'memory_cost' => $this->memory($options),
'time_cost' => $this->time($options),
- 'threads' => $this->processors($options)
+ 'threads' => $this->processors($options),
]);
}
@@ -157,4 +157,4 @@ protected function processors($options)
{
return $options['processors'] ?? $this->processors;
}
-}
\ No newline at end of file
+} | false |
Other | laravel | framework | 68ac51a3c85d039799d32f53a045328e14debfea.json | implement contract on manager | src/Illuminate/Foundation/helpers.php | @@ -188,14 +188,12 @@ function base_path($path = '')
* Hash the given value against the bcrypt algorithm.
*
* @param string $value
- * @param array $options
+ * @param array $options
* @return string
*/
function bcrypt($value, $options = [])
{
- return app('hash')
- ->driver('bcrypt')
- ->make($value, $options);
+ return app('hash')->driver('bcrypt')->make($value, $options);
}
}
| true |
Other | laravel | framework | 68ac51a3c85d039799d32f53a045328e14debfea.json | implement contract on manager | src/Illuminate/Hashing/HashManager.php | @@ -3,19 +3,10 @@
namespace Illuminate\Hashing;
use Illuminate\Support\Manager;
+use Illuminate\Contracts\Hashing\Hasher;
-class HashManager extends Manager
+class HashManager extends Manager implements Hasher
{
- /**
- * Get the default driver name.
- *
- * @return string
- */
- public function getDefaultDriver()
- {
- return $this->app['config']['hashing.driver'];
- }
-
/**
* Create an instance of the Brycrypt hash Driver.
*
@@ -35,4 +26,51 @@ public function createArgonDriver()
{
return new ArgonHasher;
}
-}
\ No newline at end of file
+
+ /**
+ * Hash the given value.
+ *
+ * @param string $value
+ * @param array $options
+ * @return string
+ */
+ public function make($value, array $options = [])
+ {
+ return $this->driver()->make($value, $options);
+ }
+
+ /**
+ * Check the given plain value against a hash.
+ *
+ * @param string $value
+ * @param string $hashedValue
+ * @param array $options
+ * @return bool
+ */
+ public function check($value, $hashedValue, array $options = [])
+ {
+ return $this->driver()->check($value, $hashedValue, $options);
+ }
+
+ /**
+ * Check if the given hash has been hashed using the given options.
+ *
+ * @param string $hashedValue
+ * @param array $options
+ * @return bool
+ */
+ public function needsRehash($hashedValue, array $options = [])
+ {
+ return $this->driver()->needsRehash($hashedValue, $options);
+ }
+
+ /**
+ * Get the default driver name.
+ *
+ * @return string
+ */
+ public function getDefaultDriver()
+ {
+ return $this->app['config']['hashing.driver'];
+ }
+} | true |
Other | laravel | framework | e35a60f7f3ef1d75754522771f13762b3058f1b0.json | Apply fixes from StyleCI (#21966) | src/Illuminate/Database/Concerns/ManagesTransactions.php | @@ -63,7 +63,7 @@ protected function handleTransactionException($e, $currentAttempt, $maxAttempts)
// let the developer handle it in another way. We will decrement too.
if ($this->causedByDeadlock($e) &&
$this->transactions > 1) {
- --$this->transactions;
+ $this->transactions--;
throw $e;
}
@@ -91,7 +91,7 @@ public function beginTransaction()
{
$this->createTransaction();
- ++$this->transactions;
+ $this->transactions++;
$this->fireConnectionEvent('beganTransaction');
} | true |
Other | laravel | framework | e35a60f7f3ef1d75754522771f13762b3058f1b0.json | Apply fixes from StyleCI (#21966) | src/Illuminate/Database/Eloquent/Model.php | @@ -924,7 +924,7 @@ public function newCollection(array $models = [])
* @param string|null $using
* @return \Illuminate\Database\Eloquent\Relations\Pivot
*/
- public function newPivot(Model $parent, array $attributes, $table, $exists, $using = null)
+ public function newPivot(self $parent, array $attributes, $table, $exists, $using = null)
{
return $using ? $using::fromRawAttributes($parent, $attributes, $table, $exists)
: Pivot::fromAttributes($parent, $attributes, $table, $exists); | true |
Other | laravel | framework | e35a60f7f3ef1d75754522771f13762b3058f1b0.json | Apply fixes from StyleCI (#21966) | src/Illuminate/Database/Query/Builder.php | @@ -1222,7 +1222,7 @@ public function orWhereNotExists(Closure $callback)
* @param bool $not
* @return $this
*/
- public function addWhereExistsQuery(Builder $query, $boolean = 'and', $not = false)
+ public function addWhereExistsQuery(self $query, $boolean = 'and', $not = false)
{
$type = $not ? 'NotExists' : 'Exists';
@@ -2341,7 +2341,7 @@ public function addBinding($value, $type = 'where')
* @param \Illuminate\Database\Query\Builder $query
* @return $this
*/
- public function mergeBindings(Builder $query)
+ public function mergeBindings(self $query)
{
$this->bindings = array_merge_recursive($this->bindings, $query->bindings);
| true |
Other | laravel | framework | e35a60f7f3ef1d75754522771f13762b3058f1b0.json | Apply fixes from StyleCI (#21966) | tests/Filesystem/FilesystemTest.php | @@ -366,7 +366,7 @@ public function testSharedGet()
$content = str_repeat('123456', 1000000);
$result = 1;
- for ($i = 1; $i <= 20; ++$i) {
+ for ($i = 1; $i <= 20; $i++) {
$pid = pcntl_fork();
if (! $pid) { | true |
Other | laravel | framework | e35a60f7f3ef1d75754522771f13762b3058f1b0.json | Apply fixes from StyleCI (#21966) | tests/Support/SupportArrTest.php | @@ -473,19 +473,19 @@ public function testRandomThrowsAnErrorWhenRequestingMoreItemsThanAreAvailable()
try {
Arr::random([]);
} catch (\InvalidArgumentException $e) {
- ++$exceptions;
+ $exceptions++;
}
try {
Arr::random([], 1);
} catch (\InvalidArgumentException $e) {
- ++$exceptions;
+ $exceptions++;
}
try {
Arr::random([], 2);
} catch (\InvalidArgumentException $e) {
- ++$exceptions;
+ $exceptions++;
}
$this->assertSame(3, $exceptions); | true |
Other | laravel | framework | d0ed106a5d5ecebaf7ded27153d630222284422a.json | Apply fixes from StyleCI (#21933) | tests/Integration/Routing/FluentRoutingTest.php | @@ -37,7 +37,6 @@ public function test_middleware_run_when_registered_as_array_or_params()
}
}
-
class Middleware
{
public function handle($request, $next) | false |
Other | laravel | framework | e2d178ce435c9dbfafdada423b0b839fcda5c82f.json | fix various formatting problems | src/Illuminate/Database/Schema/Blueprint.php | @@ -119,6 +119,7 @@ public function toSql(Connection $connection, Grammar $grammar)
/**
* Add the commands that are implied by the blueprint's state.
*
+ * @param \Illuminate\Database\Grammar $grammer
* @return void
*/
protected function addImpliedCommands(Grammar $grammar)
@@ -166,6 +167,12 @@ protected function addFluentIndexes()
}
}
+ /**
+ * Add the fluent commands specified on any columns.
+ *
+ * @param \Illuminate\Database\Grammar $grammer
+ * @param
+ */
public function addFluentCommands(Grammar $grammar)
{
foreach ($this->columns as $column) { | true |
Other | laravel | framework | e2d178ce435c9dbfafdada423b0b839fcda5c82f.json | fix various formatting problems | src/Illuminate/Database/Schema/Grammars/Grammar.php | @@ -20,7 +20,7 @@ abstract class Grammar extends BaseGrammar
protected $transactions = false;
/**
- * Enable other commands to be executed outside of create or alter command (like indexes).
+ * The commands to be executed outside of create or alter command.
*
* @var array
*/
@@ -127,14 +127,6 @@ protected function getType(Fluent $column)
return $this->{'type'.ucfirst($column->type)}($column);
}
- /**
- * @return array
- */
- public function getFluentCommands()
- {
- return $this->fluentCommands;
- }
-
/**
* Add the column modifiers to the definition.
*
@@ -258,6 +250,16 @@ public function getDoctrineTableDiff(Blueprint $blueprint, SchemaManager $schema
});
}
+ /**
+ * Get the fluent commands for the grammar.
+ *
+ * @return array
+ */
+ public function getFluentCommands()
+ {
+ return $this->fluentCommands;
+ }
+
/**
* Check if this Grammar supports schema changes wrapped in a transaction.
* | true |
Other | laravel | framework | e2d178ce435c9dbfafdada423b0b839fcda5c82f.json | fix various formatting problems | src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php | @@ -23,18 +23,18 @@ class PostgresGrammar extends Grammar
protected $modifiers = ['Increment', 'Nullable', 'Default'];
/**
- * Enable other commands to be executed outside of create or alter command (like indexes).
+ * The columns available as serials.
*
* @var array
*/
- protected $fluentCommands = ['Comment'];
+ protected $serials = ['bigInteger', 'integer', 'mediumInteger', 'smallInteger', 'tinyInteger'];
/**
- * The columns available as serials.
+ * The commands to be executed outside of create or alter command.
*
* @var array
*/
- protected $serials = ['bigInteger', 'integer', 'mediumInteger', 'smallInteger', 'tinyInteger'];
+ protected $fluentCommands = ['Comment'];
/**
* Compile the query to determine if a table exists.
@@ -305,7 +305,7 @@ public function compileDisableForeignKeyConstraints()
}
/**
- * Compile a plain index key command.
+ * Compile a comment command.
*
* @param \Illuminate\Database\Schema\Blueprint $blueprint
* @param \Illuminate\Support\Fluent $command | true |
Other | laravel | framework | 46df31abe2e24a94a59062e334f5615c9a080962.json | Apply fixes from StyleCI (#21880) | tests/Integration/Database/EloquentHasManyThroughTest.php | @@ -55,12 +55,10 @@ public function basic_create_and_retrieve()
$notMember = User::create(['name' => str_random()]);
-
$this->assertEquals([$member1->id, $member2->id], $user->members->pluck('id')->toArray());
}
}
-
class User extends Model
{
public $table = 'users'; | false |
Other | laravel | framework | 7e61340b4526db767f68efe454a6dd59ba266ef9.json | update docblock to include the Throwable (#21878)
* update dockblock to include the Throwable
* Update helpers.php | src/Illuminate/Support/helpers.php | @@ -1063,6 +1063,7 @@ function throw_if($boolean, $exception, ...$parameters)
* @param \Throwable|string $exception
* @param array ...$parameters
* @return void
+ * @throws \Throwable
*/
function throw_unless($boolean, $exception, ...$parameters)
{ | false |
Other | laravel | framework | ca3146d72fab9f06a24e197f556654780c93dead.json | Fix uniqueStrict for keyless collections (#21854) | src/Illuminate/Support/Collection.php | @@ -1482,10 +1482,6 @@ public function transform(callable $callback)
*/
public function unique($key = null, $strict = false)
{
- if (is_null($key)) {
- return new static(array_unique($this->items, SORT_REGULAR));
- }
-
$callback = $this->valueRetriever($key);
$exists = []; | false |
Other | laravel | framework | b1781b01469dd5e88c774510c5ddefa23b6a734e.json | Update DatabaseNotificationCollection.php (#21841)
Improve documentation :D | src/Illuminate/Notifications/DatabaseNotificationCollection.php | @@ -7,7 +7,7 @@
class DatabaseNotificationCollection extends Collection
{
/**
- * Mark all notification as read.
+ * Mark all notifications as read.
*
* @return void
*/ | false |
Other | laravel | framework | 1f63a505d8844e021f9161728b6c3d33bc0cb9a6.json | Remove non-existent argument (#21814) | tests/Database/DatabaseMigrationMakeCommandTest.php | @@ -17,8 +17,7 @@ public function testBasicCreateDumpsAutoload()
{
$command = new MigrateMakeCommand(
$creator = m::mock('Illuminate\Database\Migrations\MigrationCreator'),
- $composer = m::mock('Illuminate\Support\Composer'),
- __DIR__.'/vendor'
+ $composer = m::mock('Illuminate\Support\Composer')
);
$app = new \Illuminate\Foundation\Application;
$app->useDatabasePath(__DIR__);
@@ -33,8 +32,7 @@ public function testBasicCreateGivesCreatorProperArguments()
{
$command = new MigrateMakeCommand(
$creator = m::mock('Illuminate\Database\Migrations\MigrationCreator'),
- m::mock('Illuminate\Support\Composer')->shouldIgnoreMissing(),
- __DIR__.'/vendor'
+ m::mock('Illuminate\Support\Composer')->shouldIgnoreMissing()
);
$app = new \Illuminate\Foundation\Application;
$app->useDatabasePath(__DIR__);
@@ -48,8 +46,7 @@ public function testBasicCreateGivesCreatorProperArgumentsWhenTableIsSet()
{
$command = new MigrateMakeCommand(
$creator = m::mock('Illuminate\Database\Migrations\MigrationCreator'),
- m::mock('Illuminate\Support\Composer')->shouldIgnoreMissing(),
- __DIR__.'/vendor'
+ m::mock('Illuminate\Support\Composer')->shouldIgnoreMissing()
);
$app = new \Illuminate\Foundation\Application;
$app->useDatabasePath(__DIR__);
@@ -63,8 +60,7 @@ public function testBasicCreateGivesCreatorProperArgumentsWhenCreateTablePattern
{
$command = new MigrateMakeCommand(
$creator = m::mock('Illuminate\Database\Migrations\MigrationCreator'),
- m::mock('Illuminate\Support\Composer')->shouldIgnoreMissing(),
- __DIR__.'/vendor'
+ m::mock('Illuminate\Support\Composer')->shouldIgnoreMissing()
);
$app = new \Illuminate\Foundation\Application;
$app->useDatabasePath(__DIR__);
@@ -78,8 +74,7 @@ public function testCanSpecifyPathToCreateMigrationsIn()
{
$command = new MigrateMakeCommand(
$creator = m::mock('Illuminate\Database\Migrations\MigrationCreator'),
- m::mock('Illuminate\Support\Composer')->shouldIgnoreMissing(),
- __DIR__.'/vendor'
+ m::mock('Illuminate\Support\Composer')->shouldIgnoreMissing()
);
$app = new \Illuminate\Foundation\Application;
$command->setLaravel($app); | true |
Other | laravel | framework | 1f63a505d8844e021f9161728b6c3d33bc0cb9a6.json | Remove non-existent argument (#21814) | tests/Database/DatabaseMigrationMigrateCommandTest.php | @@ -16,7 +16,7 @@ public function tearDown()
public function testBasicMigrationsCallMigratorWithProperArguments()
{
- $command = new MigrateCommand($migrator = m::mock('Illuminate\Database\Migrations\Migrator'), __DIR__.'/vendor');
+ $command = new MigrateCommand($migrator = m::mock('Illuminate\Database\Migrations\Migrator'));
$app = new ApplicationDatabaseMigrationStub(['path.database' => __DIR__]);
$app->useDatabasePath(__DIR__);
$command->setLaravel($app);
@@ -31,7 +31,7 @@ public function testBasicMigrationsCallMigratorWithProperArguments()
public function testMigrationRepositoryCreatedWhenNecessary()
{
- $params = [$migrator = m::mock('Illuminate\Database\Migrations\Migrator'), __DIR__.'/vendor'];
+ $params = [$migrator = m::mock('Illuminate\Database\Migrations\Migrator')];
$command = $this->getMockBuilder('Illuminate\Database\Console\Migrations\MigrateCommand')->setMethods(['call'])->setConstructorArgs($params)->getMock();
$app = new ApplicationDatabaseMigrationStub(['path.database' => __DIR__]);
$app->useDatabasePath(__DIR__);
@@ -48,7 +48,7 @@ public function testMigrationRepositoryCreatedWhenNecessary()
public function testTheCommandMayBePretended()
{
- $command = new MigrateCommand($migrator = m::mock('Illuminate\Database\Migrations\Migrator'), __DIR__.'/vendor');
+ $command = new MigrateCommand($migrator = m::mock('Illuminate\Database\Migrations\Migrator'));
$app = new ApplicationDatabaseMigrationStub(['path.database' => __DIR__]);
$app->useDatabasePath(__DIR__);
$command->setLaravel($app);
@@ -63,7 +63,7 @@ public function testTheCommandMayBePretended()
public function testTheDatabaseMayBeSet()
{
- $command = new MigrateCommand($migrator = m::mock('Illuminate\Database\Migrations\Migrator'), __DIR__.'/vendor');
+ $command = new MigrateCommand($migrator = m::mock('Illuminate\Database\Migrations\Migrator'));
$app = new ApplicationDatabaseMigrationStub(['path.database' => __DIR__]);
$app->useDatabasePath(__DIR__);
$command->setLaravel($app);
@@ -78,7 +78,7 @@ public function testTheDatabaseMayBeSet()
public function testStepMayBeSet()
{
- $command = new MigrateCommand($migrator = m::mock('Illuminate\Database\Migrations\Migrator'), __DIR__.'/vendor');
+ $command = new MigrateCommand($migrator = m::mock('Illuminate\Database\Migrations\Migrator'));
$app = new ApplicationDatabaseMigrationStub(['path.database' => __DIR__]);
$app->useDatabasePath(__DIR__);
$command->setLaravel($app); | true |
Other | laravel | framework | 805ec49e2d1072fdc4a687743d94ba5ba49bae9e.json | Apply fixes from StyleCI (#21811) | src/Illuminate/Mail/Events/MessageSent.php | @@ -4,7 +4,6 @@
class MessageSent
{
-
/**
* The Swift message instance.
* | false |
Other | laravel | framework | 1dffaadee4405c30232e1243c35f98d137f16d35.json | Add Type Hint to Model Factory Stub (#21810)
I find myself adding this type hint to every model factory that I
create to help IDEs auto complete the $factory object. | src/Illuminate/Database/Console/Factories/stubs/factory.stub | @@ -2,6 +2,8 @@
use Faker\Generator as Faker;
+/* @var Illuminate\Database\Eloquent\Factory $factory */
+
$factory->define(DummyModel::class, function (Faker $faker) {
return [
// | false |
Other | laravel | framework | 727bd9eb4dacd504ec6c34516485694225971c31.json | add `notifyNow` method to Notifiables (#21795)
allows user to override notifications with the `ShouldQueue` interface, and send them immediately. | src/Illuminate/Notifications/RoutesNotifications.php | @@ -18,6 +18,18 @@ public function notify($instance)
app(Dispatcher::class)->send($this, $instance);
}
+ /**
+ * Send the given notification immediately.
+ *
+ * @param mixed $instance
+ * @param array|null $channels
+ * @return void
+ */
+ public function notifyNow($instance, array $channels = null)
+ {
+ app(Dispatcher::class)->sendNow($this, $instance, $channels);
+ }
+
/**
* Get the notification routing information for the given driver.
* | true |
Other | laravel | framework | 727bd9eb4dacd504ec6c34516485694225971c31.json | add `notifyNow` method to Notifiables (#21795)
allows user to override notifications with the `ShouldQueue` interface, and send them immediately. | tests/Notifications/NotificationRoutesNotificationsTest.php | @@ -28,6 +28,19 @@ public function testNotificationCanBeDispatched()
$notifiable->notify($instance);
}
+ public function testNotificationCanBeSentNow()
+ {
+ $container = new Container;
+ $factory = Mockery::mock(Dispatcher::class);
+ $container->instance(Dispatcher::class, $factory);
+ $notifiable = new RoutesNotificationsTestInstance;
+ $instance = new stdClass;
+ $factory->shouldReceive('sendNow')->with($notifiable, $instance, null);
+ Container::setInstance($container);
+
+ $notifiable->notifyNow($instance);
+ }
+
public function testNotificationOptionRouting()
{
$instance = new RoutesNotificationsTestInstance; | true |
Other | laravel | framework | 382f8d6d754cc19828948796821376495397285e.json | Add a from helper method (#21788) | src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php | @@ -122,6 +122,17 @@ public function followingRedirects()
return $this;
}
+ /**
+ * Set the referer header to simulate a previous request.
+ *
+ * @param string $url
+ * @return $this
+ */
+ public function from(string $url)
+ {
+ return $this->withHeader('referer', $url);
+ }
+
/**
* Visit the given URI with a GET request.
* | false |
Other | laravel | framework | 030d5212d89be18b5b91133f1c01fce68e433b63.json | Add followingRedirects() method | src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php | @@ -25,6 +25,13 @@ trait MakesHttpRequests
*/
protected $serverVariables = [];
+ /**
+ * Whether redirects should be followed.
+ *
+ * @var bool
+ */
+ protected $followRedirects = false;
+
/**
* Define additional headers to be sent with the request.
*
@@ -103,6 +110,18 @@ public function handle($request, $next)
return $this;
}
+ /**
+ * Automatically follow any redirects returned from the response.
+ *
+ * @return $this
+ */
+ public function followingRedirects()
+ {
+ $this->followRedirects = true;
+
+ return $this;
+ }
+
/**
* Visit the given URI with a GET request.
*
@@ -294,6 +313,10 @@ public function call($method, $uri, $parameters = [], $cookies = [], $files = []
$request = Request::createFromBase($symfonyRequest)
);
+ if ($this->followRedirects) {
+ $response = $this->followRedirects($response);
+ }
+
$kernel->terminate($request, $response);
return $this->createTestResponse($response);
@@ -375,6 +398,21 @@ protected function extractFilesFromDataArray(&$data)
return $files;
}
+ /**
+ * Follow a redirect chain until a non-redirect is received.
+ *
+ * @param \Illuminate\Http\Response $response
+ * @return \Illuminate\Http\Response
+ */
+ protected function followRedirects($response)
+ {
+ while ($response->isRedirect()) {
+ $response = $this->get($response->headers->get('Location'));
+ }
+
+ return $response;
+ }
+
/**
* Create the test response instance from the given response.
* | false |
Other | laravel | framework | b74afbf25b8f2c2dfcc60994a932c81fa7a7ba1a.json | fix typo in changelog | CHANGELOG-5.5.md | @@ -3,7 +3,7 @@
## v5.5.18 (2017-10-19)
### Added
-- Make `Redirector` macroable ([#21714](https://github.com/laravel/framework/pull/21714))
+- Made `Redirector` macroable ([#21714](https://github.com/laravel/framework/pull/21714))
### Changed
- Prevent reloading default relationships while lazy eager-loading ([#21710](https://github.com/laravel/framework/pull/21710)) | false |
Other | laravel | framework | 639ddda89dd3d9466b6e9e68a7ebdb06f1fe6700.json | Apply fixes from StyleCI (#21716) | src/Illuminate/Routing/Redirector.php | @@ -9,7 +9,7 @@
class Redirector
{
use Macroable;
-
+
/**
* The URL generator instance.
* | false |
Other | laravel | framework | d5284858c0ec6453173f4fc72f77190c5e886c15.json | Fix example component tag name (#21711) | src/Illuminate/Foundation/Console/Presets/vue-stubs/app.js | @@ -15,7 +15,7 @@ window.Vue = require('vue');
* or customize the JavaScript scaffolding to fit your unique needs.
*/
-Vue.component('example', require('./components/ExampleComponent.vue'));
+Vue.component('example-component', require('./components/ExampleComponent.vue'));
const app = new Vue({
el: '#app' | false |
Other | laravel | framework | d15ad0fdf2d1fef63600eeccf57d756d28571614.json | swap the index order of morph type and id (#21693)
It can be utilize the index when query the type by using "WHERE type = ?",
also "WHERE type IN (?)" | src/Illuminate/Database/Schema/Blueprint.php | @@ -1033,11 +1033,11 @@ public function multiPolygon($column)
*/
public function morphs($name, $indexName = null)
{
- $this->unsignedInteger("{$name}_id");
-
$this->string("{$name}_type");
- $this->index(["{$name}_id", "{$name}_type"], $indexName);
+ $this->unsignedInteger("{$name}_id");
+
+ $this->index(["{$name}_type", "{$name}_id"], $indexName);
}
/**
@@ -1049,11 +1049,11 @@ public function morphs($name, $indexName = null)
*/
public function nullableMorphs($name, $indexName = null)
{
- $this->unsignedInteger("{$name}_id")->nullable();
-
$this->string("{$name}_type")->nullable();
- $this->index(["{$name}_id", "{$name}_type"], $indexName);
+ $this->unsignedInteger("{$name}_id")->nullable();
+
+ $this->index(["{$name}_type", "{$name}_id"], $indexName);
}
/** | false |
Other | laravel | framework | 532c49d1dbcd63decd9fa5037fc2510e5f955103.json | Use Arr::wrap when calling seeders (#21707) | src/Illuminate/Database/Seeder.php | @@ -2,6 +2,7 @@
namespace Illuminate\Database;
+use Illuminate\Support\Arr;
use InvalidArgumentException;
use Illuminate\Console\Command;
use Illuminate\Container\Container;
@@ -31,7 +32,7 @@ abstract class Seeder
*/
public function call($class, $silent = false)
{
- $classes = is_array($class) ? $class : (array) $class;
+ $classes = Arr::wrap($class);
foreach ($classes as $class) {
if ($silent === false && isset($this->command)) { | false |
Other | laravel | framework | dd0f61ca160c1e349517145d0887786f8a6eba3d.json | Fix typos in Limiter Builders (#21698) | src/Illuminate/Redis/Limiters/ConcurrencyLimiterBuilder.php | @@ -97,7 +97,7 @@ public function block($timeout)
}
/**
- * Execute the given callback if a lock is obtained, otherise call the failure callback.
+ * Execute the given callback if a lock is obtained, otherwise call the failure callback.
*
* @param callable $callback
* @param callable|null $failure | true |
Other | laravel | framework | dd0f61ca160c1e349517145d0887786f8a6eba3d.json | Fix typos in Limiter Builders (#21698) | src/Illuminate/Redis/Limiters/DurationLimiterBuilder.php | @@ -97,7 +97,7 @@ public function block($timeout)
}
/**
- * Execute the given callback if a lock is obtained, otherise call the failure callback.
+ * Execute the given callback if a lock is obtained, otherwise call the failure callback.
*
* @param callable $callback
* @param callable|null $failure | true |
Other | laravel | framework | 2000c97988d40dd873dba1d2e787d8c2312a98c9.json | Update Paginator.php (#21656)
Rename argument `hasMorePagesWhen()` to something more descriptive. | src/Illuminate/Pagination/Paginator.php | @@ -114,12 +114,12 @@ public function render($view = null, $data = [])
/**
* Manually indicate that the paginator does have more pages.
*
- * @param bool $value
+ * @param bool $hasMore
* @return $this
*/
- public function hasMorePagesWhen($value = true)
+ public function hasMorePagesWhen($hasMore = true)
{
- $this->hasMore = $value;
+ $this->hasMore = $hasMore;
return $this;
} | false |
Other | laravel | framework | e88c8b2780f0d0142aa4bcea00c1acb2b30402a4.json | Remove unused parameter from list; (#21565) | src/Illuminate/Foundation/Http/Kernel.php | @@ -210,7 +210,7 @@ protected function terminateMiddleware($request, $response)
continue;
}
- list($name, $parameters) = $this->parseMiddleware($middleware);
+ list($name) = $this->parseMiddleware($middleware);
$instance = $this->app->make($name);
| false |
Other | laravel | framework | fffc0729425278165d29a0b9f1d98aeb43e71057.json | Apply fixes from StyleCI (#21564) | src/Illuminate/Foundation/Console/ModelMakeCommand.php | @@ -149,7 +149,7 @@ protected function getOptions()
['migration', 'm', InputOption::VALUE_NONE, 'Create a new migration file for the model.'],
['pivot', 'p', InputOption::VALUE_NONE, 'Indicates if the generated model should be a custom intermediate table model.'],
-
+
['resource', 'r', InputOption::VALUE_NONE, 'Indicates if the generated controller should be a resource controller.'],
];
} | false |
Other | laravel | framework | d35e24c409598c231371369dabc8cdc8c92a11d6.json | Apply fixes from StyleCI (#21514) | src/Illuminate/Foundation/Console/ExceptionMakeCommand.php | @@ -44,7 +44,6 @@ protected function getStub()
return $this->option('report')
? __DIR__.'/stubs/exception-report.stub'
: __DIR__.'/stubs/exception.stub';
-
}
/** | false |
Other | laravel | framework | 46529ae3f24f69c65e159c8cdb16ce21da36a44c.json | Remove unnecessary else statement | src/Illuminate/Foundation/Console/ExceptionMakeCommand.php | @@ -39,11 +39,12 @@ protected function getStub()
return $this->option('report')
? __DIR__.'/stubs/exception-render-report.stub'
: __DIR__.'/stubs/exception-render.stub';
- } else {
- return $this->option('report')
- ? __DIR__.'/stubs/exception-report.stub'
- : __DIR__.'/stubs/exception.stub';
}
+
+ return $this->option('report')
+ ? __DIR__.'/stubs/exception-report.stub'
+ : __DIR__.'/stubs/exception.stub';
+
}
/** | false |
Other | laravel | framework | 7d8d81693aaa18d07e3fe0cd6e380a7518361406.json | add mapToDictionary tests | tests/Support/SupportCollectionTest.php | @@ -1257,6 +1257,35 @@ public function testFlatMap()
$this->assertEquals(['programming', 'basketball', 'music', 'powerlifting'], $data->all());
}
+ public function testMapToDictionary()
+ {
+ $data = new Collection([
+ ['id' => 1, 'name' => 'A'],
+ ['id' => 2, 'name' => 'B'],
+ ['id' => 3, 'name' => 'C'],
+ ['id' => 4, 'name' => 'B'],
+ ]);
+
+ $groups = $data->mapToDictionary(function ($item, $key) {
+ return [$item['name'] => $item['id']];
+ });
+
+ $this->assertInstanceOf(Collection::class, $groups);
+ $this->assertEquals(['A' => [1], 'B' => [2, 4], 'C' => [3]], $groups->toArray());
+ $this->assertInternalType('array', $groups['A']);
+ }
+
+ public function testMapToDictionaryWithNumericKeys()
+ {
+ $data = new Collection([1, 2, 3, 2, 1]);
+
+ $groups = $data->mapToDictionary(function ($item, $key) {
+ return [$item => $key];
+ });
+
+ $this->assertEquals([1 => [0, 4], 2 => [1, 3], 3 => [2]], $groups->toArray());
+ }
+
public function testMapToGroups()
{
$data = new Collection([ | false |
Other | laravel | framework | 7892af3b333a8668688d9505d8eedd7f94cdc6cc.json | Fix docblock in Route (#21454) | src/Illuminate/Support/Facades/Route.php | @@ -21,7 +21,7 @@
* @method \Illuminate\Support\Facades\Route domain(string $value)
* @method \Illuminate\Support\Facades\Route name(string $value)
* @method \Illuminate\Support\Facades\Route namespace(string $value)
- * @method \Illuminate\Routing\Route group(string $value)
+ * @method \Illuminate\Routing\Route group(array $value)
* @method \Illuminate\Support\Facades\Route redirect(string $uri, string $destination, int $status = 301)
* @method \Illuminate\Support\Facades\Route view(string $uri, string $view, array $data = [])
* | false |
Other | laravel | framework | dc7c76d28d5dad3ee1223be6019f3cad4afded13.json | Fix spelling of 'optionally' | src/Illuminate/Support/helpers.php | @@ -1154,7 +1154,7 @@ function windows_os()
if (! function_exists('with')) {
/**
- * Return the given value, optionaly passed through the given callback.
+ * Return the given value, optionally passed through the given callback.
*
* @param mixed $value
* @param callable|null $callback | false |
Other | laravel | framework | 7133f119d28e2767cb8ae5ea5cc74cc166c892cf.json | Apply fixes from StyleCI (#21418) | src/Illuminate/Validation/ValidationException.php | @@ -3,8 +3,8 @@
namespace Illuminate\Validation;
use Exception;
-use Illuminate\Support\Facades\Validator as ValidatorFacade;
use Illuminate\Support\Arr;
+use Illuminate\Support\Facades\Validator as ValidatorFacade;
class ValidationException extends Exception
{ | false |
Other | laravel | framework | c5d02773392041b28dec8855aeee85246b8d7d17.json | Add the batch number to migrate:status command | src/Illuminate/Database/Console/Migrations/StatusCommand.php | @@ -56,9 +56,10 @@ public function handle()
}
$ran = $this->migrator->getRepository()->getRan();
+ $migrationsBatches = $this->migrator->getRepository()->getMigrationsBatches();
- if (count($migrations = $this->getStatusFor($ran)) > 0) {
- $this->table(['Ran?', 'Migration'], $migrations);
+ if (count($migrations = $this->getStatusFor($ran, $migrationsBatches)) > 0) {
+ $this->table(['Ran?', 'Migration', 'Batch'], $migrations);
} else {
$this->error('No migrations found');
}
@@ -68,16 +69,17 @@ public function handle()
* Get the status for the given ran migrations.
*
* @param array $ran
+ * @param array $migrationsBatches
* @return \Illuminate\Support\Collection
*/
- protected function getStatusFor(array $ran)
+ protected function getStatusFor(array $ran, array $migrationsBatches)
{
return Collection::make($this->getAllMigrationFiles())
- ->map(function ($migration) use ($ran) {
+ ->map(function ($migration) use ($ran, $migrationsBatches) {
$migrationName = $this->migrator->getMigrationName($migration);
return in_array($migrationName, $ran)
- ? ['<info>Y</info>', $migrationName]
+ ? ['<info>Y</info>', $migrationName, $migrationsBatches[$migrationName]]
: ['<fg=red>N</fg=red>', $migrationName];
});
} | true |
Other | laravel | framework | c5d02773392041b28dec8855aeee85246b8d7d17.json | Add the batch number to migrate:status command | src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php | @@ -53,6 +53,19 @@ public function getRan()
->pluck('migration')->all();
}
+ /**
+ * Get the ran migrations with batch numbers.
+ *
+ * @return array
+ */
+ public function getMigrationsBatches()
+ {
+ return $this->table()
+ ->orderBy('batch', 'asc')
+ ->orderBy('migration', 'asc')
+ ->pluck('batch', 'migration')->all();
+ }
+
/**
* Get list of migrations.
* | true |
Other | laravel | framework | c5d02773392041b28dec8855aeee85246b8d7d17.json | Add the batch number to migrate:status command | src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php | @@ -11,6 +11,13 @@ interface MigrationRepositoryInterface
*/
public function getRan();
+ /**
+ * Get the ran migrations with batch numbers for a given package.
+ *
+ * @return array
+ */
+ public function getMigrationsBatches();
+
/**
* Get list of migrations.
* | true |
Other | laravel | framework | 266b60e56066617fe60acb145b79348a094852cb.json | Add changelog for 5.5.12 release (#21334) | CHANGELOG-5.5.md | @@ -1,5 +1,13 @@
# Release Notes for 5.5.x
+## v5.5.12 (2017-09-22)
+
+### Added
+- Added "software" as an uncountable word ([#21324](https://github.com/laravel/framework/pull/21324))
+
+### Fixed
+- Fixed null remember token error on EloquentUserProvider ([#21328](https://github.com/laravel/framework/pull/21328))
+
## v5.5.11 (2017-09-21)
### Fixed | false |
Other | laravel | framework | c39faf75ab5eca770a66be8032ac5c599ed904f9.json | add config option for whoops blacklist | src/Illuminate/Foundation/Exceptions/Handler.php | @@ -365,6 +365,12 @@ protected function whoopsHandler()
$handler->handleUnconditionally(true);
+ foreach (config('whoops.blacklist', []) as $key => $secrets) {
+ foreach ($secrets as $secret) {
+ $handler->blacklist($key, $secret);
+ }
+ }
+
$handler->setApplicationPaths(
array_flip(Arr::except(
array_flip($files->directories(base_path())), [base_path('vendor')] | false |
Other | laravel | framework | 28eca8519cb055a97ccd1fcb420900a235c2cbf6.json | add v5.5.11 release notes | CHANGELOG-5.5.md | @@ -1,5 +1,11 @@
# Release Notes for 5.5.x
+## v5.5.11 (2017-09-21)
+
+### Fixed
+- Fixed bug in `EloquentUserProvider` introduced in [#21320](https://github.com/laravel/framework/pull/21320) ([#21323](https://github.com/laravel/framework/pull/21323))
+
+
## v5.5.10 (2017-09-21)
### Added | false |
Other | laravel | framework | c5e231f953b02c605ab8c29f1f0b3fe9d9ebc26c.json | add v5.5.10 release notes | CHANGELOG-5.5.md | @@ -1,5 +1,23 @@
# Release Notes for 5.5.x
+## v5.5.10 (2017-09-21)
+
+### Added
+- Added `Route::respondWithRoute($name)` method ([#21299](https://github.com/laravel/framework/pull/21299), [66c5e46](https://github.com/laravel/framework/commit/66c5e462dbdb9d0c9d23114da3a3dc1b6e9fa0a1))
+- Added `$strict` parameter to `TestResponse::assertJson()` ([#21301](https://github.com/laravel/framework/pull/21301))
+
+### Changed
+- Added "firmware" as an uncountable word ([#21306](https://github.com/laravel/framework/pull/21306))
+- Allow `MorphTo::associate()` accept `null` ([#21318](https://github.com/laravel/framework/pull/21318))
+- Changed `__()` signature to match `Translation::trans()` ([10c013c](https://github.com/laravel/framework/commit/10c013c564b7e518640e42e97d9178f9e05ec7d9))
+
+### Fixed
+- Add missing `driver` parameter to doctrine connection ([#21297](https://github.com/laravel/framework/pull/21297))
+
+### Security
+- Perform constant-time token comparison in `DatabaseUserProvider` ([#21320](https://github.com/laravel/framework/pull/21320))
+
+
## v5.5.9 (2017-09-20)
### Changed | false |
Other | laravel | framework | 22471ae267f35311b0f2ff4fd7ba4cbf32c3577d.json | Remove trailing white-space. | src/Illuminate/Auth/EloquentUserProvider.php | @@ -63,7 +63,7 @@ public function retrieveByToken($identifier, $token)
$model = $this->createModel()->newQuery()
->where($model->getAuthIdentifierName(), $identifier)
->first();
-
+
return $model && hash_equals($model->getRememberToken(), $token) ? $model : null;
}
| false |
Other | laravel | framework | 0cf3027150a1d7d519f00ce0282ac29b8cd4c64e.json | Add driver parameter for new doctrine connection
Fix sqlite create database missing driver parameter. | src/Illuminate/Database/Connection.php | @@ -892,10 +892,15 @@ public function getDoctrineSchemaManager()
public function getDoctrineConnection()
{
if (is_null($this->doctrineConnection)) {
- $data = ['pdo' => $this->getPdo(), 'dbname' => $this->getConfig('database')];
+ $driver = $this->getDoctrineDriver();
+ $data = [
+ 'pdo' => $this->getPdo(),
+ 'dbname' => $this->getConfig('database'),
+ 'driver' => $driver->getName(),
+ ];
$this->doctrineConnection = new DoctrineConnection(
- $data, $this->getDoctrineDriver()
+ $data, $driver
);
}
| false |
Other | laravel | framework | 0c024f0f225942e0a80953902dce4b0e91e77c27.json | Initialize empty array for `$values` | src/Illuminate/Support/Collection.php | @@ -1340,6 +1340,7 @@ public function sort(callable $callback = null)
*/
public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
{
+ $values = [];
$results = [];
$callback = $this->valueRetriever($callback); | false |
Other | laravel | framework | 978f5cebd40c8ed939d2a89644c56938d61cddd4.json | Avoid re-ordering routes (#21261)
* dont reorder routes
* update | src/Illuminate/Routing/RouteCollection.php | @@ -189,7 +189,11 @@ public function match(Request $request)
*/
protected function matchAgainstRoutes(array $routes, $request, $includingMethod = true)
{
- return collect($routes)->sortBy('isFallback')->first(function ($value) use ($request, $includingMethod) {
+ list($fallbacks, $routes) = collect($routes)->partition(function ($route) {
+ return $route->isFallback;
+ });
+
+ return $routes->merge($fallbacks)->first(function ($value) use ($request, $includingMethod) {
return $value->matches($request, $includingMethod);
});
} | true |
Other | laravel | framework | 978f5cebd40c8ed939d2a89644c56938d61cddd4.json | Avoid re-ordering routes (#21261)
* dont reorder routes
* update | tests/Integration/Routing/FallbackRouteTest.php | @@ -49,16 +49,36 @@ public function test_fallback_with_wildcards()
return response('fallback', 404);
});
+ Route::get('one', function () {
+ return 'one';
+ });
+
Route::get('{any}', function () {
return 'wildcard';
})->where('any', '.*');
+ $this->assertContains('one', $this->get('/one')->getContent());
+ $this->assertContains('wildcard', $this->get('/non-existing')->getContent());
+ $this->assertEquals(200, $this->get('/non-existing')->getStatusCode());
+ }
+
+ public function test_no_routes()
+ {
+ Route::fallback(function () {
+ return response('fallback', 404);
+ });
+
+ $this->assertContains('fallback', $this->get('/non-existing')->getContent());
+ $this->assertEquals(404, $this->get('/non-existing')->getStatusCode());
+ }
+
+ public function test_no_fallbacks()
+ {
Route::get('one', function () {
return 'one';
});
$this->assertContains('one', $this->get('/one')->getContent());
- $this->assertContains('wildcard', $this->get('/non-existing')->getContent());
- $this->assertEquals(200, $this->get('/non-existing')->getStatusCode());
+ $this->assertEquals(200, $this->get('/one')->getStatusCode());
}
} | true |
Other | laravel | framework | 8001e8616acbc467c77b8b02bc7787d6a9555b23.json | add release notes for v5.5.6 and v5.5.7 | CHANGELOG-5.5.md | @@ -1,5 +1,20 @@
# Release Notes for 5.5.x
+## v5.5.7 (2017-09-19)
+
+### Fixed
+- Fix `CacheClearCommand` binding ([#21256](https://github.com/laravel/framework/pull/21256))
+
+
+## v5.5.6 (2017-09-19)
+
+### Changed
+- Clear real-time facades when running `cache:clear` ([#21250](https://github.com/laravel/framework/pull/21250), [1856601](https://github.com/laravel/framework/commit/185660178ad213140411ca27550cdaf44c650002))
+
+### Fixed
+- Reverted stable sort support in `Collection::sortBy()` ([#21255](https://github.com/laravel/framework/pull/21255))
+
+
## v5.5.5 (2017-09-19)
### Added | false |
Other | laravel | framework | d72ecc447b40e77629891b9fdeb6b64db7411ff4.json | Simplify "app" function. (#21241) | src/Illuminate/Foundation/helpers.php | @@ -107,9 +107,7 @@ function app($abstract = null, array $parameters = [])
return Container::getInstance();
}
- return empty($parameters)
- ? Container::getInstance()->make($abstract)
- : Container::getInstance()->makeWith($abstract, $parameters);
+ return Container::getInstance()->make($abstract, $parameters);
}
}
| false |
Other | laravel | framework | 230bb3a7403bd6a0c3933d75a10af93a34df7007.json | Update Laracasts videos stats in readme (#21213) | README.md | @@ -26,7 +26,7 @@ Laravel is accessible, yet powerful, providing tools needed for large, robust ap
Laravel has the most extensive and thorough documentation and video tutorial library of any modern web application framework. The [Laravel documentation](https://laravel.com/docs) is thorough, complete, and makes it a breeze to get started learning the framework.
-If you're not in the mood to read, [Laracasts](https://laracasts.com) contains over 900 video tutorials covering a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library.
+If you're not in the mood to read, [Laracasts](https://laracasts.com) contains over 1100 video tutorials covering a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library.
## Contributing
| false |
Other | laravel | framework | 4572938cce79d8a8a0f222c8bdca2768332e9f19.json | Add shortcut to model option (#21219) | src/Illuminate/Database/Console/Factories/FactoryMakeCommand.php | @@ -78,7 +78,7 @@ protected function getPath($name)
protected function getOptions()
{
return [
- ['model', null, InputOption::VALUE_OPTIONAL, 'The name of the model'],
+ ['model', 'm', InputOption::VALUE_OPTIONAL, 'The name of the model'],
];
}
} | false |
Other | laravel | framework | 85c1081b26b7cd2411f5ab9b2b5c734e22931933.json | remove unneeded order lines | tests/Integration/Queue/ModelSerializationTest.php | @@ -154,7 +154,6 @@ public function it_reloads_relationships()
Line::create(['order_id' => $order->id, 'product_id' => $product1->id]);
Line::create(['order_id' => $order->id, 'product_id' => $product2->id]);
- Line::create(['order_id' => $order->id, 'product_id' => $product1->id]);
$order->load('lines');
@@ -176,7 +175,6 @@ public function it_reloads_nested_relationships()
Line::create(['order_id' => $order->id, 'product_id' => $product1->id]);
Line::create(['order_id' => $order->id, 'product_id' => $product2->id]);
- Line::create(['order_id' => $order->id, 'product_id' => $product1->id]);
$order->load('lines', 'lines.product');
| false |
Other | laravel | framework | 1d8a3d59055b7f21bc4d13d7d40eed914b716ebc.json | Apply fixes from StyleCI (#21174) | tests/Integration/Database/EloquentMorphManyTest.php | @@ -72,7 +72,6 @@ public function comments()
}
}
-
class Comment extends Model
{
public $table = 'comments'; | false |
Other | laravel | framework | f319ed27348f7bd1796f6e238e577a8269ca84e2.json | Apply fixes from StyleCI (#21168) | tests/Notifications/NotificationMailMessageTest.php | @@ -20,5 +20,4 @@ public function testTemplate()
$this->assertEquals('notifications::foo', $this->message->markdown);
}
-
-}
\ No newline at end of file
+} | false |
Other | laravel | framework | 4d8f0a1a72fe9ea915570df2ef58cbafd43ec96a.json | remove type hint | src/Illuminate/Database/Eloquent/Model.php | @@ -1031,10 +1031,10 @@ public function is($model)
/**
* Determine if two models are not the same.
*
- * @param \Illuminate\Database\Eloquent\Model $model
+ * @param \Illuminate\Database\Eloquent\Model|null $model
* @return bool
*/
- public function isNot(Model $model)
+ public function isNot($model)
{
return ! $this->is($model);
} | false |
Other | laravel | framework | 28eea5fde6816c6620190ffe80dd9da06753e0c9.json | Apply fixes from StyleCI (#21129) | tests/Integration/Http/ResourceTest.php | @@ -2,7 +2,6 @@
namespace Illuminate\Tests\Integration\Http;
-use Illuminate\Tests\Integration\Http\Fixtures\PostResourceWithOptionalMerging;
use Orchestra\Testbench\TestCase;
use Illuminate\Support\Facades\Route;
use Illuminate\Pagination\LengthAwarePaginator;
@@ -17,6 +16,7 @@
use Illuminate\Tests\Integration\Http\Fixtures\PostResourceWithExtraData;
use Illuminate\Tests\Integration\Http\Fixtures\EmptyPostCollectionResource;
use Illuminate\Tests\Integration\Http\Fixtures\PostResourceWithOptionalData;
+use Illuminate\Tests\Integration\Http\Fixtures\PostResourceWithOptionalMerging;
use Illuminate\Tests\Integration\Http\Fixtures\PostResourceWithOptionalRelationship;
use Illuminate\Tests\Integration\Http\Fixtures\PostResourceWithOptionalPivotRelationship;
| false |
Other | laravel | framework | cb70c44c5b01e6d449e9e32b8234f9854fabb932.json | Apply fixes from StyleCI (#21104) | src/Illuminate/Console/Scheduling/ManagesFrequencies.php | @@ -367,7 +367,6 @@ public function yearly()
->spliceIntoPosition(4, 1);
}
-
/**
* Set the days of the week the command should run on.
* | false |
Other | laravel | framework | fbf0e9e0a17704068fc6158438455f8dde82e748.json | add hasReplyTo method (#21093) | src/Illuminate/Mail/Mailable.php | @@ -460,6 +460,18 @@ public function replyTo($address, $name = null)
return $this->setAddress($address, $name, 'replyTo');
}
+ /**
+ * Determine if the given recipient is set on the mailable.
+ *
+ * @param object|array|string $address
+ * @param string|null $name
+ * @return bool
+ */
+ public function hasReplyTo($address, $name = null)
+ {
+ return $this->hasRecipient($address, $name, 'replyTo');
+ }
+
/**
* Set the recipients of the message.
* | true |
Other | laravel | framework | fbf0e9e0a17704068fc6158438455f8dde82e748.json | add hasReplyTo method (#21093) | tests/Mail/MailMailableTest.php | @@ -54,6 +54,53 @@ public function testMailableSetsRecipientsCorrectly()
$this->assertTrue($mailable->hasTo('taylor@laravel.com'));
}
+ public function testMailableSetsReplyToCorrectly()
+ {
+ $mailable = new WelcomeMailableStub;
+ $mailable->replyTo('taylor@laravel.com');
+ $this->assertEquals([['name' => null, 'address' => 'taylor@laravel.com']], $mailable->replyTo);
+ $this->assertTrue($mailable->hasReplyTo('taylor@laravel.com'));
+
+ $mailable = new WelcomeMailableStub;
+ $mailable->replyTo('taylor@laravel.com', 'Taylor Otwell');
+ $this->assertEquals([['name' => 'Taylor Otwell', 'address' => 'taylor@laravel.com']], $mailable->replyTo);
+ $this->assertTrue($mailable->hasReplyTo('taylor@laravel.com', 'Taylor Otwell'));
+ $this->assertTrue($mailable->hasReplyTo('taylor@laravel.com'));
+
+ $mailable = new WelcomeMailableStub;
+ $mailable->replyTo(['taylor@laravel.com']);
+ $this->assertEquals([['name' => null, 'address' => 'taylor@laravel.com']], $mailable->replyTo);
+ $this->assertTrue($mailable->hasReplyTo('taylor@laravel.com'));
+ $this->assertFalse($mailable->hasReplyTo('taylor@laravel.com', 'Taylor Otwell'));
+
+ $mailable = new WelcomeMailableStub;
+ $mailable->replyTo([['name' => 'Taylor Otwell', 'email' => 'taylor@laravel.com']]);
+ $this->assertEquals([['name' => 'Taylor Otwell', 'address' => 'taylor@laravel.com']], $mailable->replyTo);
+ $this->assertTrue($mailable->hasReplyTo('taylor@laravel.com', 'Taylor Otwell'));
+ $this->assertTrue($mailable->hasReplyTo('taylor@laravel.com'));
+
+ $mailable = new WelcomeMailableStub;
+ $mailable->replyTo(new MailableTestUserStub);
+ $this->assertEquals([['name' => 'Taylor Otwell', 'address' => 'taylor@laravel.com']], $mailable->replyTo);
+ $this->assertTrue($mailable->hasReplyTo(new MailableTestUserStub));
+ $this->assertTrue($mailable->hasReplyTo('taylor@laravel.com'));
+
+ $mailable = new WelcomeMailableStub;
+ $mailable->replyTo(collect([new MailableTestUserStub]));
+ $this->assertEquals([['name' => 'Taylor Otwell', 'address' => 'taylor@laravel.com']], $mailable->replyTo);
+ $this->assertTrue($mailable->hasReplyTo(new MailableTestUserStub));
+ $this->assertTrue($mailable->hasReplyTo('taylor@laravel.com'));
+
+ $mailable = new WelcomeMailableStub;
+ $mailable->replyTo(collect([new MailableTestUserStub, new MailableTestUserStub]));
+ $this->assertEquals([
+ ['name' => 'Taylor Otwell', 'address' => 'taylor@laravel.com'],
+ ['name' => 'Taylor Otwell', 'address' => 'taylor@laravel.com'],
+ ], $mailable->replyTo);
+ $this->assertTrue($mailable->hasReplyTo(new MailableTestUserStub));
+ $this->assertTrue($mailable->hasReplyTo('taylor@laravel.com'));
+ }
+
public function testMailableBuildsViewData()
{
$mailable = new WelcomeMailableStub; | true |
Other | laravel | framework | e2b48c006965ccce5c0a98b11a974c97cf410198.json | Fix exception handling (#21086) | src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php | @@ -11,11 +11,11 @@
trait InteractsWithExceptionHandling
{
/**
- * The previous exception handler.
+ * The original exception handler.
*
* @var ExceptionHandler|null
*/
- protected $previousExceptionHandler;
+ protected $originalExceptionHandler;
/**
* Restore exception handling.
@@ -24,8 +24,8 @@ trait InteractsWithExceptionHandling
*/
protected function withExceptionHandling()
{
- if ($this->previousExceptionHandler) {
- $this->app->instance(ExceptionHandler::class, $this->previousExceptionHandler);
+ if ($this->originalExceptionHandler) {
+ $this->app->instance(ExceptionHandler::class, $this->originalExceptionHandler);
}
return $this;
@@ -60,11 +60,13 @@ protected function handleValidationExceptions()
*/
protected function withoutExceptionHandling(array $except = [])
{
- $this->previousExceptionHandler = app(ExceptionHandler::class);
+ if ($this->originalExceptionHandler == null) {
+ $this->originalExceptionHandler = app(ExceptionHandler::class);
+ }
- $this->app->instance(ExceptionHandler::class, new class($this->previousExceptionHandler, $except) implements ExceptionHandler {
+ $this->app->instance(ExceptionHandler::class, new class($this->originalExceptionHandler, $except) implements ExceptionHandler {
protected $except;
- protected $previousHandler;
+ protected $originalHandler;
/**
* Create a new class instance.
@@ -73,10 +75,10 @@ protected function withoutExceptionHandling(array $except = [])
* @param array $except
* @return void
*/
- public function __construct($previousHandler, $except = [])
+ public function __construct($originalHandler, $except = [])
{
$this->except = $except;
- $this->previousHandler = $previousHandler;
+ $this->originalHandler = $originalHandler;
}
/**
@@ -109,7 +111,7 @@ public function render($request, Exception $e)
foreach ($this->except as $class) {
if ($e instanceof $class) {
- return $this->previousHandler->render($request, $e);
+ return $this->originalHandler->render($request, $e);
}
}
| false |
Other | laravel | framework | ac95aa4162280c1d762049f3004ea33354f2409a.json | Add release date (#21074) | CHANGELOG-5.5.md | @@ -1,6 +1,6 @@
# Release Notes for 5.5.x
-## [Unreleased]
+## v5.5.3 (2017-09-07)
### Added
- Added `$action` parameter to `Route::getAction()` for simpler access ([#20975](https://github.com/laravel/framework/pull/20975)) | false |
Other | laravel | framework | 6981580ef2555fbd593b1eb7aa1b765cfde122e7.json | add a compileForeign method to PostgresGrammar.php
Allow support of deferrable option in an "add constraint foreign key" statement | src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php | @@ -623,4 +623,25 @@ protected function modifyIncrement(Blueprint $blueprint, Fluent $column)
return ' primary key';
}
}
+
+ /**
+ * Compile a foreign key command.
+ *
+ * @param \Illuminate\Database\Schema\Blueprint $blueprint
+ * @param \Illuminate\Support\Fluent $command
+ * @return string
+ */
+ public function compileForeign(Blueprint $blueprint, Fluent $command)
+ {
+ // The \Illuminate\Database\Schema\Grammars\Grammar method compiles the classical statement
+ $sql = parent::compileForeign($blueprint, $command);
+
+ // Here we add the Postgres specific "deferrable" part
+ if(! is_null($command->deferrable)) {
+ $sql .= " {$command->deferrable}";
+ }
+
+ return $sql;
+ }
+
} | false |
Other | laravel | framework | 8eb3de12720c7bd53a411748ad282bfbda57a948.json | Apply fixes from StyleCI (#21035) | src/Illuminate/Contracts/Foundation/Application.php | @@ -33,8 +33,8 @@ public function environment();
* @return bool
*/
public function runningInConsole();
-
- /**
+
+ /**
* Determine if we are running unit tests.
*
* @return bool | false |
Other | laravel | framework | ac700f0ef4e684b07a00d4626c847007fa3da471.json | Update docblock to match expectations (#21031) | src/Illuminate/Queue/Failed/DatabaseFailedJobProvider.php | @@ -77,7 +77,7 @@ public function all()
* Get a single failed job.
*
* @param mixed $id
- * @return array
+ * @return object|null
*/
public function find($id)
{ | true |
Other | laravel | framework | ac700f0ef4e684b07a00d4626c847007fa3da471.json | Update docblock to match expectations (#21031) | src/Illuminate/Queue/Failed/FailedJobProviderInterface.php | @@ -26,7 +26,7 @@ public function all();
* Get a single failed job.
*
* @param mixed $id
- * @return array
+ * @return object|null
*/
public function find($id);
| true |
Other | laravel | framework | ac700f0ef4e684b07a00d4626c847007fa3da471.json | Update docblock to match expectations (#21031) | src/Illuminate/Queue/Failed/NullFailedJobProvider.php | @@ -32,7 +32,7 @@ public function all()
* Get a single failed job.
*
* @param mixed $id
- * @return array
+ * @return object|null
*/
public function find($id)
{ | true |
Other | laravel | framework | a8130c7e4ff2888b3949751259b45f287bf518a0.json | Remove unnecessary lcfirst call (#21017) | src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php | @@ -82,7 +82,7 @@ protected function normalizeGuessedAbilityName($ability)
*/
public function authorizeResource($model, $parameter = null, array $options = [], $request = null)
{
- $parameter = $parameter ?: Str::snake(lcfirst(class_basename($model)));
+ $parameter = $parameter ?: Str::snake(class_basename($model));
$middleware = [];
| false |
Other | laravel | framework | a6209ea0f81a1be448d28c38b815c1750ff96d12.json | add test with new lines | tests/Validation/ValidationInRuleTest.php | @@ -18,6 +18,10 @@ public function testItCorrectlyFormatsAStringVersionOfTheRule()
$this->assertEquals('in:"Life, the Universe and Everything","this is a ""quote"""', (string) $rule);
+ $rule = new In(["a,b\nc,d"]);
+
+ $this->assertEquals("in:\"a,b\nc,d\"", (string) $rule);
+
$rule = Rule::in([1, 2, 3, 4]);
$this->assertEquals('in:"1","2","3","4"', (string) $rule); | true |
Other | laravel | framework | a6209ea0f81a1be448d28c38b815c1750ff96d12.json | add test with new lines | tests/Validation/ValidationValidatorTest.php | @@ -1430,7 +1430,10 @@ public function testValidateIn()
$v = new Validator($trans, ['name' => ['foo,bar', 'qux']], ['name' => 'Array|In:"foo,bar",baz,qux']);
$this->assertTrue($v->passes());
- $v = new Validator($trans, ['name' => ['f"o"o', 'qux']], ['name' => 'Array|In:"f""o""o",baz,qux']);
+ $v = new Validator($trans, ['name' => 'f"o"o'], ['name' => 'In:"f""o""o",baz,qux']);
+ $this->assertTrue($v->passes());
+
+ $v = new Validator($trans, ['name' => "a,b\nc,d"], ['name' => "in:\"a,b\nc,d\""]);
$this->assertTrue($v->passes());
$v = new Validator($trans, ['name' => ['foo', 'bar']], ['name' => 'Alpha|In:foo,bar']); | true |
Other | laravel | framework | d5af3bfb655e1e4bed3ebac45efcba6338ae681e.json | Fix typo in HasAttributes trait | src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php | @@ -314,7 +314,7 @@ public function getAttribute($key)
}
// Here we will determine if the model base class itself contains this given key
- // since we do not want to treat any of those methods are relationships since
+ // since we do not want to treat any of those methods as relationships since
// they are all intended as helper methods and none of these are relations.
if (method_exists(self::class, $key)) {
return; | false |
Other | laravel | framework | 931bc761ea9d6dba79bdedd444820f3e79c07b95.json | add rescue helper | src/Illuminate/Support/helpers.php | @@ -742,6 +742,21 @@ function preg_replace_array($pattern, array $replacements, $subject)
}
}
+if (! function_exists('rescue')) {
+ function rescue(callable $rescuee, $rescuer)
+ {
+ try {
+ return $rescuee();
+ } catch (Exception $e) {
+ if (is_callable($rescuer)) {
+ return $rescuer();
+ }
+
+ return $rescuer;
+ }
+ }
+}
+
if (! function_exists('retry')) {
/**
* Retry an operation a given number of times. | true |
Other | laravel | framework | 931bc761ea9d6dba79bdedd444820f3e79c07b95.json | add rescue helper | tests/Support/SupportHelpersTest.php | @@ -3,6 +3,7 @@
namespace Illuminate\Tests\Support;
use stdClass;
+use Exception;
use ArrayAccess;
use Mockery as m;
use RuntimeException;
@@ -794,6 +795,23 @@ public function something()
})->present()->something());
}
+ public function testRescue()
+ {
+ $this->assertEquals(rescue(function () {
+ throw new Exception;
+ }, 'rescued!'), 'rescued!');
+
+ $this->assertEquals(rescue(function () {
+ throw new Exception;
+ }, function () {
+ return 'rescued!';
+ }), 'rescued!');
+
+ $this->assertEquals(rescue(function () {
+ return 'no need to rescue';
+ }, 'rescued!'), 'no need to rescue');
+ }
+
public function testTransform()
{
$this->assertEquals(10, transform(5, function ($value) { | true |
Other | laravel | framework | 2d150b59250f018bfe03d8d4a7acd4a58cc1c9d6.json | Apply fixes from StyleCI (#21006) | src/Illuminate/Console/GeneratorCommand.php | @@ -81,7 +81,7 @@ public function handle()
protected function qualifyClass($name)
{
$name = ltrim($name, '\\/');
-
+
$rootNamespace = $this->rootNamespace();
if (Str::startsWith($name, $rootNamespace)) { | true |
Other | laravel | framework | 2d150b59250f018bfe03d8d4a7acd4a58cc1c9d6.json | Apply fixes from StyleCI (#21006) | src/Illuminate/Foundation/Http/FormRequest.php | @@ -174,7 +174,7 @@ public function validated()
{
$rules = $this->container->call([$this, 'rules']);
- return $this->only(collect($rules)->keys()->map(function($rule){
+ return $this->only(collect($rules)->keys()->map(function ($rule) {
return str_contains($rule, '.') ? explode('.', $rule)[0] : $rule;
})->unique()->toArray());
} | true |
Other | laravel | framework | 2d150b59250f018bfe03d8d4a7acd4a58cc1c9d6.json | Apply fixes from StyleCI (#21006) | src/Illuminate/Foundation/Providers/FoundationServiceProvider.php | @@ -38,8 +38,7 @@ public function registerRequestValidate()
Request::macro('validate', function (array $rules, ...$params) {
validator()->validate($this->all(), $rules, ...$params);
-
- return $this->only(collect($rules)->keys()->map(function($rule){
+ return $this->only(collect($rules)->keys()->map(function ($rule) {
return str_contains($rule, '.') ? explode('.', $rule)[0] : $rule;
})->unique()->toArray());
}); | true |
Other | laravel | framework | 2d150b59250f018bfe03d8d4a7acd4a58cc1c9d6.json | Apply fixes from StyleCI (#21006) | src/Illuminate/Foundation/Validation/ValidatesRequests.php | @@ -25,9 +25,9 @@ public function validateWith($validator, Request $request = null)
$validator->validate();
- return $request->only(collect($validator->getRules())->keys()->map(function($rule){
- return str_contains($rule, '.') ? explode('.', $rule)[0] : $rule;
- })->unique()->toArray());
+ return $request->only(collect($validator->getRules())->keys()->map(function ($rule) {
+ return str_contains($rule, '.') ? explode('.', $rule)[0] : $rule;
+ })->unique()->toArray());
}
/**
@@ -46,7 +46,7 @@ public function validate(Request $request, array $rules,
->make($request->all(), $rules, $messages, $customAttributes)
->validate();
- return $request->only(collect($rules)->keys()->map(function($rule){
+ return $request->only(collect($rules)->keys()->map(function ($rule) {
return str_contains($rule, '.') ? explode('.', $rule)[0] : $rule;
})->unique()->toArray());
} | true |
Other | laravel | framework | 2d150b59250f018bfe03d8d4a7acd4a58cc1c9d6.json | Apply fixes from StyleCI (#21006) | tests/Integration/Http/ResourceTest.php | @@ -2,11 +2,11 @@
namespace Illuminate\Tests\Integration\Http;
-use Illuminate\Tests\Integration\Http\Fixtures\Author;
use Orchestra\Testbench\TestCase;
use Illuminate\Support\Facades\Route;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Tests\Integration\Http\Fixtures\Post;
+use Illuminate\Tests\Integration\Http\Fixtures\Author;
use Illuminate\Tests\Integration\Http\Fixtures\PostResource;
use Illuminate\Tests\Integration\Http\Fixtures\Subscription;
use Illuminate\Tests\Integration\Http\Fixtures\PostCollectionResource;
@@ -133,7 +133,7 @@ public function test_resources_may_load_optional_relationships()
$response->assertExactJson([
'data' => [
'id' => 5,
- 'author' => ['name' => 'jrrmartin']
+ 'author' => ['name' => 'jrrmartin'],
],
]);
}
@@ -160,7 +160,7 @@ public function test_resources_may_shows_null_for_loaded_relationship_with_value
$response->assertExactJson([
'data' => [
'id' => 5,
- 'author' => null
+ 'author' => null,
],
]);
} | true |
Other | laravel | framework | 2d150b59250f018bfe03d8d4a7acd4a58cc1c9d6.json | Apply fixes from StyleCI (#21006) | tests/Routing/RoutingRouteTest.php | @@ -308,23 +308,23 @@ public function testMacro()
$this->assertEquals('OK', $router->dispatch(Request::create('webhook', 'GET'))->getContent());
$this->assertEquals('OK', $router->dispatch(Request::create('webhook', 'POST'))->getContent());
}
-
+
public function testRouteMacro()
{
$router = $this->getRouter();
-
+
Route::macro('breadcrumb', function ($breadcrumb) {
$this->action['breadcrumb'] = $breadcrumb;
-
+
return $this;
});
-
+
$router->get('foo', function () {
return 'bar';
})->breadcrumb('fooBreadcrumb')->name('foo');
-
+
$router->getRoutes()->refreshNameLookups();
-
+
$this->assertEquals('fooBreadcrumb', $router->getRoutes()->getByName('foo')->getAction()['breadcrumb']);
}
| true |
Other | laravel | framework | 264845d0a480b943db3cc40f5a252b39c694a20a.json | Use new concern
Use new CompilesJson concern | src/Illuminate/View/Compilers/BladeCompiler.php | @@ -14,6 +14,7 @@ class BladeCompiler extends Compiler implements CompilerInterface
Concerns\CompilesEchos,
Concerns\CompilesIncludes,
Concerns\CompilesInjections,
+ Concerns\CompilesJson,
Concerns\CompilesLayouts,
Concerns\CompilesLoops,
Concerns\CompilesRawPhp, | false |
Other | laravel | framework | 3ab997b61501808f1aa20f8a8ac6c426764a3f55.json | Create CompilesJson concern
Create a new concern for a new json statement | src/Illuminate/View/Compilers/Concerns/CompilesJson.php | @@ -0,0 +1,19 @@
+<?php
+
+namespace Illuminate\View\Compilers\Concerns;
+
+trait CompilesJson
+{
+ /**
+ * Compile the json statement into valid PHP.
+ *
+ * @param string $expression
+ * @param int $options
+ * @param int $depth
+ * @return string
+ */
+ protected function compileJson($expression, $options = 0, $depth = 512)
+ {
+ return "<?php echo json_encode($expression, $options, $depth) ?>";
+ }
+} | false |
Other | laravel | framework | 250b25d6404a6b3c8f933bae63f6d194188f863f.json | Update phpdocs for QueryBuilder (#20988) | src/Illuminate/Database/Query/Builder.php | @@ -27,7 +27,7 @@ class Builder
/**
* The database connection instance.
*
- * @var \Illuminate\Database\Connection
+ * @var \Illuminate\Database\ConnectionInterface
*/
public $connection;
@@ -334,8 +334,8 @@ public function from($table)
*
* @param string $table
* @param string $first
- * @param string $operator
- * @param string $second
+ * @param string|null $operator
+ * @param string|null $second
* @param string $type
* @param bool $where
* @return $this
@@ -389,8 +389,8 @@ public function joinWhere($table, $first, $operator, $second, $type = 'inner')
*
* @param string $table
* @param string $first
- * @param string $operator
- * @param string $second
+ * @param string|null $operator
+ * @param string|null $second
* @return \Illuminate\Database\Query\Builder|static
*/
public function leftJoin($table, $first, $operator = null, $second = null)
@@ -417,8 +417,8 @@ public function leftJoinWhere($table, $first, $operator, $second)
*
* @param string $table
* @param string $first
- * @param string $operator
- * @param string $second
+ * @param string|null $operator
+ * @param string|null $second
* @return \Illuminate\Database\Query\Builder|static
*/
public function rightJoin($table, $first, $operator = null, $second = null)
@@ -444,9 +444,9 @@ public function rightJoinWhere($table, $first, $operator, $second)
* Add a "cross join" clause to the query.
*
* @param string $table
- * @param string $first
- * @param string $operator
- * @param string $second
+ * @param string|null $first
+ * @param string|null $operator
+ * @param string|null $second
* @return \Illuminate\Database\Query\Builder|static
*/
public function crossJoin($table, $first = null, $operator = null, $second = null)
@@ -480,7 +480,7 @@ public function mergeWheres($wheres, $bindings)
* Add a basic where clause to the query.
*
* @param string|array|\Closure $column
- * @param string $operator
+ * @param string|null $operator
* @param mixed $value
* @param string $boolean
* @return $this
@@ -625,7 +625,7 @@ protected function invalidOperator($operator)
* Add an "or where" clause to the query.
*
* @param string|array|\Closure $column
- * @param string $operator
+ * @param string|null $operator
* @param mixed $value
* @return \Illuminate\Database\Query\Builder|static
*/
@@ -1317,8 +1317,8 @@ public function groupBy(...$groups)
* Add a "having" clause to the query.
*
* @param string $column
- * @param string $operator
- * @param string $value
+ * @param string|null $operator
+ * @param string|null $value
* @param string $boolean
* @return $this
*/
@@ -1353,8 +1353,8 @@ public function having($column, $operator = null, $value = null, $boolean = 'and
* Add a "or having" clause to the query.
*
* @param string $column
- * @param string $operator
- * @param string $value
+ * @param string|null $operator
+ * @param string|null $value
* @return \Illuminate\Database\Query\Builder|static
*/
public function orHaving($column, $operator = null, $value = null)
@@ -2123,7 +2123,7 @@ public function insert(array $values)
* Insert a new record and get the value of the primary key.
*
* @param array $values
- * @param string $sequence
+ * @param string|null $sequence
* @return int
*/
public function insertGetId(array $values, $sequence = null) | false |
Other | laravel | framework | 3c9b37cbff2a722b1f6f537528806c3e18fe920f.json | Update phpdocs for DatabasePresenceVerifier | src/Illuminate/Validation/DatabasePresenceVerifier.php | @@ -39,9 +39,9 @@ public function __construct(ConnectionResolverInterface $db)
* @param string $collection
* @param string $column
* @param string $value
- * @param int $excludeId
- * @param string $idColumn
- * @param array $extra
+ * @param int|null $excludeId
+ * @param string|null $idColumn
+ * @param array $extra
* @return int
*/
public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = []) | false |
Other | laravel | framework | d92260860d34c54ac94024456e5568f9fb991893.json | Update phpdocs for PasswordBroker | src/Illuminate/Auth/Passwords/PasswordBroker.php | @@ -107,7 +107,7 @@ public function reset(array $credentials, Closure $callback)
* Validate a password reset for the given credentials.
*
* @param array $credentials
- * @return \Illuminate\Contracts\Auth\CanResetPassword
+ * @return \Illuminate\Contracts\Auth\CanResetPassword|string
*/
protected function validateReset(array $credentials)
{
@@ -179,7 +179,7 @@ protected function validatePasswordWithDefaults(array $credentials)
* Get the user for the given credentials.
*
* @param array $credentials
- * @return \Illuminate\Contracts\Auth\CanResetPassword
+ * @return \Illuminate\Contracts\Auth\CanResetPassword|null
*
* @throws \UnexpectedValueException
*/ | false |
Other | laravel | framework | 2bb9fbb4990800775929ef195bba9cb845a3d7e3.json | Fix docblock for Str::is() (#20958)
Commit ceb59c14748504e9f900674419fddda5ba37838e added the ability for `Str::is()` to handle multiple patterns instead of just one, but the docblock has not been updated to reflect this change. | src/Illuminate/Support/Str.php | @@ -143,7 +143,7 @@ public static function finish($value, $cap)
/**
* Determine if a given string matches a given pattern.
*
- * @param string $pattern
+ * @param string|array $pattern
* @param string $value
* @return bool
*/ | false |
Other | laravel | framework | d913110b40d3497eeaca81cc00d02a9572876d93.json | Remove invalid commit from changes (#20955) | CHANGELOG-5.5.md | @@ -39,7 +39,7 @@
- Fixed `DelegatesToResource::offsetExists()` ([#20887](https://github.com/laravel/framework/pull/20887))
### Removed
-- Removed redundant methods from `MorphOneOrMany` ([#20837](https://github.com/laravel/framework/pull/20837), [891f90e](https://github.com/laravel/framework/commit/891f90ea48056979add7319c5642501c8678bc9c))
+- Removed redundant methods from `MorphOneOrMany` ([#20837](https://github.com/laravel/framework/pull/20837))
## v5.5.0 (2017-08-30) | false |
Other | laravel | framework | 747771405090139378b648742ccc73649c100099.json | add 5.6 changelog | CHANGELOG-5.6.md | @@ -0,0 +1,6 @@
+# Release Notes for 5.6.x
+
+## [Unreleased]
+
+### Artisan Console
+- Removed deprecated `optimize` command ([#20851](https://github.com/laravel/framework/pull/20851)) | false |
Other | laravel | framework | 08f4380eec23dd7765583d1de1bdacca41b2a6e4.json | Add detection of `dont-discover` in packages | src/Illuminate/Foundation/PackageManifest.php | @@ -118,6 +118,10 @@ public function build()
$this->write(collect($packages)->mapWithKeys(function ($package) {
return [$this->format($package['name']) => $package['extra']['laravel'] ?? []];
+ })->each(function ($configuration) use (&$ignore) {
+ if ($configuration['dont-discover'] ?? false) {
+ $ignore += $configuration['dont-discover'];
+ }
})->reject(function ($configuration, $package) use ($ignore, $ignoreAll) {
return $ignoreAll || in_array($package, $ignore);
})->filter()->all()); | true |
Other | laravel | framework | 08f4380eec23dd7765583d1de1bdacca41b2a6e4.json | Add detection of `dont-discover` in packages | tests/Foundation/fixtures/vendor/composer/installed.json | @@ -11,7 +11,10 @@
"providers": "foo",
"aliases": {
"Foo": "Foo\\Facade"
- }
+ },
+ "dont-discover": [
+ "vendor_a/package_d"
+ ]
}
}
},
@@ -29,5 +32,15 @@
{
"name": "vendor_a/package_c",
"type": "library"
+ },
+ {
+ "name": "vendor_a/package_d",
+ "extra": {
+ "laravel": {
+ "providers": [
+ "bazinga"
+ ]
+ }
+ }
}
] | true |
Other | laravel | framework | d79f1385aa9a67a2fb48d678f5224530a4e8c650.json | Use imported classes (#20915) | src/Illuminate/Foundation/Exceptions/Handler.php | @@ -53,13 +53,13 @@ class Handler implements ExceptionHandlerContract
* @var array
*/
protected $internalDontReport = [
- \Illuminate\Auth\AuthenticationException::class,
- \Illuminate\Auth\Access\AuthorizationException::class,
- \Symfony\Component\HttpKernel\Exception\HttpException::class,
+ AuthenticationException::class,
+ AuthorizationException::class,
+ HttpException::class,
HttpResponseException::class,
- \Illuminate\Database\Eloquent\ModelNotFoundException::class,
- \Illuminate\Session\TokenMismatchException::class,
- \Illuminate\Validation\ValidationException::class,
+ ModelNotFoundException::class,
+ TokenMismatchException::class,
+ ValidationException::class,
];
/** | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.