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
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Database/DatabaseEloquentHasManyThroughTest.php
@@ -2,12 +2,12 @@ namespace Illuminate\Tests\Database; +use stdClass; use Mockery as m; use PHPUnit\Framework\TestCase; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\Relations\HasManyThrough; -use stdClass; class DatabaseEloquentHasManyThroughTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Database/DatabaseEloquentModelTest.php
@@ -3,17 +3,17 @@ namespace Illuminate\Tests\Database; use DateTime; -use DateTimeImmutable; -use DateTimeInterface; +use stdClass; use Exception; -use LogicException; use Mockery as m; +use LogicException; +use ReflectionClass; +use DateTimeImmutable; +use DateTimeInterface; use PHPUnit\Framework\TestCase; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\Relation; -use ReflectionClass; -use stdClass; class DatabaseEloquentModelTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Database/SeedCommandTest.php
@@ -2,8 +2,8 @@ namespace Illuminate\Tests\Database; -use Illuminate\Database\Seeder; use Mockery; +use Illuminate\Database\Seeder; use PHPUnit\Framework\TestCase; use Illuminate\Container\Container; use Illuminate\Database\Console\Seeds\SeedCommand;
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Database/stubs/MigrationCreatorFakeMigration.php
@@ -2,4 +2,4 @@ class MigrationCreatorFakeMigration { -} \ No newline at end of file +}
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Http/HttpRedirectResponseTest.php
@@ -2,8 +2,8 @@ namespace Illuminate\Tests\Http; -use BadMethodCallException; use Mockery as m; +use BadMethodCallException; use Illuminate\Http\Request; use PHPUnit\Framework\TestCase; use Illuminate\Http\RedirectResponse;
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Notifications/NotificationMailChannelTest.php
@@ -3,11 +3,11 @@ namespace Illuminate\Tests\Notifications; use Mockery; +use stdClass; use PHPUnit\Framework\TestCase; use Illuminate\Support\HtmlString; use Illuminate\Notifications\Notification; use Illuminate\Notifications\Messages\MailMessage; -use stdClass; class NotificationMailChannelTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Notifications/NotificationRoutesNotificationsTest.php
@@ -3,10 +3,10 @@ namespace Illuminate\Tests\Notifications; use Mockery; +use stdClass; use PHPUnit\Framework\TestCase; use Illuminate\Container\Container; use Illuminate\Contracts\Notifications\Dispatcher; -use stdClass; class NotificationRoutesNotificationsTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Queue/QueueDatabaseQueueIntegrationTest.php
@@ -5,7 +5,7 @@ use Carbon\Carbon; use PHPUnit\Framework\TestCase; use Illuminate\Container\Container; -use \Illuminate\Queue\DatabaseQueue; +use Illuminate\Queue\DatabaseQueue; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Capsule\Manager as DB; use Illuminate\Database\Eloquent\Model as Eloquent;
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Queue/QueueDatabaseQueueUnitTest.php
@@ -2,10 +2,10 @@ namespace Illuminate\Tests\Queue; +use stdClass; use Mockery as m; -use PHPUnit\Framework\TestCase; use ReflectionClass; -use stdClass; +use PHPUnit\Framework\TestCase; class QueueDatabaseQueueUnitTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Queue/QueueWorkerTest.php
@@ -3,6 +3,7 @@ namespace Illuminate\Tests\Queue; use Mockery; +use RuntimeException; use PHPUnit\Framework\TestCase; use Illuminate\Container\Container; use Illuminate\Queue\WorkerOptions; @@ -13,7 +14,6 @@ use Illuminate\Contracts\Debug\ExceptionHandler; use Illuminate\Queue\Events\JobExceptionOccurred; use Illuminate\Queue\MaxAttemptsExceededException; -use RuntimeException; class QueueWorkerTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Queue/RedisQueueIntegrationTest.php
@@ -2,12 +2,12 @@ namespace Illuminate\Tests\Queue; -use Illuminate\Tests\Redis\InteractsWithRedis; use Mockery as m; use PHPUnit\Framework\TestCase; use Illuminate\Queue\RedisQueue; use Illuminate\Container\Container; use Illuminate\Queue\Jobs\RedisJob; +use Illuminate\Tests\Redis\InteractsWithRedis; class RedisQueueIntegrationTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Routing/RoutingRouteTest.php
@@ -2,8 +2,10 @@ namespace Illuminate\Tests\Routing; +use stdClass; use Illuminate\Http\Request; use Illuminate\Routing\Route; +use UnexpectedValueException; use Illuminate\Routing\Router; use PHPUnit\Framework\TestCase; use Illuminate\Events\Dispatcher; @@ -15,10 +17,8 @@ use Illuminate\Routing\ResourceRegistrar; use Illuminate\Contracts\Routing\Registrar; use Illuminate\Auth\Middleware\Authenticate; -use stdClass; use Symfony\Component\HttpFoundation\Response; use Illuminate\Routing\Middleware\SubstituteBindings; -use UnexpectedValueException; class RoutingRouteTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Session/EncryptedSessionStoreTest.php
@@ -3,8 +3,8 @@ namespace Illuminate\Tests\Session; use Mockery as m; -use PHPUnit\Framework\TestCase; use ReflectionClass; +use PHPUnit\Framework\TestCase; class EncryptedSessionStoreTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Session/SessionStoreTest.php
@@ -3,8 +3,8 @@ namespace Illuminate\Tests\Session; use Mockery as m; -use PHPUnit\Framework\TestCase; use ReflectionClass; +use PHPUnit\Framework\TestCase; class SessionStoreTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Support/SupportArrTest.php
@@ -2,11 +2,11 @@ namespace Illuminate\Tests\Support; +use stdClass; use ArrayObject; use Illuminate\Support\Arr; use PHPUnit\Framework\TestCase; use Illuminate\Support\Collection; -use stdClass; class SupportArrTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Support/SupportCollectionTest.php
@@ -2,16 +2,16 @@ namespace Illuminate\Tests\Support; +use stdClass; use ArrayAccess; -use JsonSerializable; use Mockery as m; +use ReflectionClass; +use JsonSerializable; use PHPUnit\Framework\TestCase; use Illuminate\Support\Collection; +use PHPUnit_Framework_Error_Notice; use Illuminate\Contracts\Support\Jsonable; use Illuminate\Contracts\Support\Arrayable; -use PHPUnit_Framework_Error_Notice; -use ReflectionClass; -use stdClass; class SupportCollectionTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Support/SupportFacadeTest.php
@@ -2,10 +2,10 @@ namespace Illuminate\Tests\Support; +use stdClass; use ArrayAccess; use Mockery as m; use PHPUnit\Framework\TestCase; -use stdClass; class SupportFacadeTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Support/SupportFluentTest.php
@@ -2,10 +2,10 @@ namespace Illuminate\Tests\Support; -use Illuminate\Support\Fluent; +use ReflectionObject; use IteratorAggregate; +use Illuminate\Support\Fluent; use PHPUnit\Framework\TestCase; -use ReflectionObject; class SupportFluentTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/Support/SupportHelpersTest.php
@@ -2,11 +2,11 @@ namespace Illuminate\Tests\Support; +use stdClass; use ArrayAccess; use Mockery as m; use Illuminate\Support\Str; use PHPUnit\Framework\TestCase; -use stdClass; class SupportHelpersTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/View/ViewEngineResolverTest.php
@@ -2,9 +2,9 @@ namespace Illuminate\Tests\View; +use stdClass; use InvalidArgumentException; use PHPUnit\Framework\TestCase; -use stdClass; class ViewEngineResolverTest extends TestCase {
true
Other
laravel
framework
a414265ee94da32004198ffe9a8ec47efb39a827.json
Apply fixes from StyleCI (#17375)
tests/View/ViewFactoryTest.php
@@ -3,9 +3,9 @@ namespace Illuminate\Tests\View; use Mockery as m; +use ReflectionFunction; use Illuminate\View\Factory; use PHPUnit\Framework\TestCase; -use ReflectionFunction; class ViewFactoryTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Auth/AuthAccessGateTest.php
@@ -2,13 +2,13 @@ namespace Illuminate\Tests\Auth; +use StdClass; use InvalidArgumentException; use PHPUnit\Framework\TestCase; use Illuminate\Auth\Access\Gate; use Illuminate\Container\Container; use Illuminate\Auth\Access\Response; use Illuminate\Auth\Access\HandlesAuthorization; -use StdClass; class GateTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Auth/AuthDatabaseTokenRepositoryTest.php
@@ -2,9 +2,9 @@ namespace Illuminate\Tests\Auth; -use Illuminate\Auth\Passwords\DatabaseTokenRepository; use Mockery as m; use PHPUnit\Framework\TestCase; +use Illuminate\Auth\Passwords\DatabaseTokenRepository; class AuthDatabaseTokenRepositoryTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Auth/AuthDatabaseUserProviderTest.php
@@ -2,9 +2,9 @@ namespace Illuminate\Tests\Auth; -use Illuminate\Auth\DatabaseUserProvider; use Mockery as m; use PHPUnit\Framework\TestCase; +use Illuminate\Auth\DatabaseUserProvider; class AuthDatabaseUserProviderTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Auth/AuthTokenGuardTest.php
@@ -2,9 +2,9 @@ namespace Illuminate\Tests\Auth; +use Mockery; use Illuminate\Http\Request; use Illuminate\Auth\TokenGuard; -use Mockery; use PHPUnit\Framework\TestCase; use Illuminate\Contracts\Auth\UserProvider;
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Auth/AuthorizeMiddlewareTest.php
@@ -2,6 +2,7 @@ namespace Illuminate\Tests\Auth; +use stdClass; use Mockery as m; use Illuminate\Http\Request; use Illuminate\Routing\Router; @@ -14,7 +15,6 @@ use Illuminate\Contracts\Auth\Factory as Auth; use Illuminate\Routing\Middleware\SubstituteBindings; use Illuminate\Contracts\Auth\Access\Gate as GateContract; -use stdClass; class AuthorizeMiddlewareTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Cache/CacheMemcachedConnectorTest.php
@@ -4,8 +4,8 @@ use Memcached; use Mockery as m; -use PHPUnit\Framework\TestCase; use RuntimeException; +use PHPUnit\Framework\TestCase; class CacheMemcachedConnectorTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Cache/CacheTaggedCacheTest.php
@@ -2,8 +2,8 @@ namespace Illuminate\Tests\Cache; -use DateInterval; use DateTime; +use DateInterval; use Mockery as m; use PHPUnit\Framework\TestCase; use Illuminate\Cache\ArrayStore;
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Container/ContainerTest.php
@@ -2,10 +2,10 @@ namespace Illuminate\Tests\Container; +use stdClass; +use ReflectionException; use PHPUnit\Framework\TestCase; use Illuminate\Container\Container; -use ReflectionException; -use stdClass; class ContainerTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Database/DatabaseConnectionFactoryTest.php
@@ -2,13 +2,13 @@ namespace Illuminate\Tests\Database; -use InvalidArgumentException; use Mockery as m; +use ReflectionProperty; +use InvalidArgumentException; use PHPUnit\Framework\TestCase; use Illuminate\Database\Connection; use Illuminate\Database\Capsule\Manager as DB; use Illuminate\Database\Connectors\ConnectionFactory; -use ReflectionProperty; class DatabaseConnectionFactoryTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Database/DatabaseConnectionTest.php
@@ -2,8 +2,8 @@ namespace Illuminate\Tests\Database; -use Mockery as m; use PDO; +use Mockery as m; use PHPUnit\Framework\TestCase; class DatabaseConnectionTest extends TestCase
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Database/DatabaseConnectorTest.php
@@ -2,8 +2,8 @@ namespace Illuminate\Tests\Database; -use Mockery as m; use PDO; +use Mockery as m; use PHPUnit\Framework\TestCase; class DatabaseConnectorTest extends TestCase
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Database/DatabaseEloquentBelongsToManyTest.php
@@ -2,15 +2,15 @@ namespace Illuminate\Tests\Database; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\ModelNotFoundException; +use stdClass; use Mockery as m; +use ReflectionClass; use PHPUnit\Framework\TestCase; +use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Collection as BaseCollection; +use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Database\Eloquent\Relations\BelongsToMany; -use ReflectionClass; -use stdClass; class DatabaseEloquentBelongsToManyTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Database/DatabaseEloquentBuilderTest.php
@@ -2,12 +2,12 @@ namespace Illuminate\Tests\Database; +use StdClass; use Mockery as m; use PHPUnit\Framework\TestCase; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Collection as BaseCollection; -use StdClass; class DatabaseEloquentBuilderTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Database/DatabaseEloquentHasManyTest.php
@@ -2,11 +2,11 @@ namespace Illuminate\Tests\Database; +use stdClass; use Mockery as m; use PHPUnit\Framework\TestCase; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Relations\HasMany; -use stdClass; class DatabaseEloquentHasManyTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Database/DatabaseEloquentHasManyThroughTest.php
@@ -2,12 +2,12 @@ namespace Illuminate\Tests\Database; +use stdClass; use Mockery as m; use PHPUnit\Framework\TestCase; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\Relations\HasManyThrough; -use stdClass; class DatabaseEloquentHasManyThroughTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Database/DatabaseEloquentModelTest.php
@@ -3,17 +3,17 @@ namespace Illuminate\Tests\Database; use DateTime; -use DateTimeImmutable; -use DateTimeInterface; +use stdClass; use Exception; -use LogicException; use Mockery as m; +use LogicException; +use ReflectionClass; +use DateTimeImmutable; +use DateTimeInterface; use PHPUnit\Framework\TestCase; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\Relation; -use ReflectionClass; -use stdClass; class DatabaseEloquentModelTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Database/SeedCommandTest.php
@@ -2,8 +2,8 @@ namespace Illuminate\Tests\Database; -use Illuminate\Database\Seeder; use Mockery; +use Illuminate\Database\Seeder; use PHPUnit\Framework\TestCase; use Illuminate\Container\Container; use Illuminate\Database\Console\Seeds\SeedCommand;
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Database/stubs/MigrationCreatorFakeMigration.php
@@ -2,4 +2,4 @@ class MigrationCreatorFakeMigration { -} \ No newline at end of file +}
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Http/HttpRedirectResponseTest.php
@@ -2,8 +2,8 @@ namespace Illuminate\Tests\Http; -use BadMethodCallException; use Mockery as m; +use BadMethodCallException; use Illuminate\Http\Request; use PHPUnit\Framework\TestCase; use Illuminate\Http\RedirectResponse;
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Notifications/NotificationMailChannelTest.php
@@ -3,11 +3,11 @@ namespace Illuminate\Tests\Notifications; use Mockery; +use stdClass; use PHPUnit\Framework\TestCase; use Illuminate\Support\HtmlString; use Illuminate\Notifications\Notification; use Illuminate\Notifications\Messages\MailMessage; -use stdClass; class NotificationMailChannelTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Notifications/NotificationRoutesNotificationsTest.php
@@ -3,10 +3,10 @@ namespace Illuminate\Tests\Notifications; use Mockery; +use stdClass; use PHPUnit\Framework\TestCase; use Illuminate\Container\Container; use Illuminate\Contracts\Notifications\Dispatcher; -use stdClass; class NotificationRoutesNotificationsTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Queue/QueueDatabaseQueueIntegrationTest.php
@@ -5,7 +5,7 @@ use Carbon\Carbon; use PHPUnit\Framework\TestCase; use Illuminate\Container\Container; -use \Illuminate\Queue\DatabaseQueue; +use Illuminate\Queue\DatabaseQueue; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Capsule\Manager as DB; use Illuminate\Database\Eloquent\Model as Eloquent;
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Queue/QueueDatabaseQueueUnitTest.php
@@ -2,10 +2,10 @@ namespace Illuminate\Tests\Queue; +use stdClass; use Mockery as m; -use PHPUnit\Framework\TestCase; use ReflectionClass; -use stdClass; +use PHPUnit\Framework\TestCase; class QueueDatabaseQueueUnitTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Queue/QueueWorkerTest.php
@@ -3,6 +3,7 @@ namespace Illuminate\Tests\Queue; use Mockery; +use RuntimeException; use PHPUnit\Framework\TestCase; use Illuminate\Container\Container; use Illuminate\Queue\WorkerOptions; @@ -13,7 +14,6 @@ use Illuminate\Contracts\Debug\ExceptionHandler; use Illuminate\Queue\Events\JobExceptionOccurred; use Illuminate\Queue\MaxAttemptsExceededException; -use RuntimeException; class QueueWorkerTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Queue/RedisQueueIntegrationTest.php
@@ -2,12 +2,12 @@ namespace Illuminate\Tests\Queue; -use Illuminate\Tests\Redis\InteractsWithRedis; use Mockery as m; use PHPUnit\Framework\TestCase; use Illuminate\Queue\RedisQueue; use Illuminate\Container\Container; use Illuminate\Queue\Jobs\RedisJob; +use Illuminate\Tests\Redis\InteractsWithRedis; class RedisQueueIntegrationTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Routing/RoutingRouteTest.php
@@ -2,8 +2,10 @@ namespace Illuminate\Tests\Routing; +use stdClass; use Illuminate\Http\Request; use Illuminate\Routing\Route; +use UnexpectedValueException; use Illuminate\Routing\Router; use PHPUnit\Framework\TestCase; use Illuminate\Events\Dispatcher; @@ -15,10 +17,8 @@ use Illuminate\Routing\ResourceRegistrar; use Illuminate\Contracts\Routing\Registrar; use Illuminate\Auth\Middleware\Authenticate; -use stdClass; use Symfony\Component\HttpFoundation\Response; use Illuminate\Routing\Middleware\SubstituteBindings; -use UnexpectedValueException; class RoutingRouteTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Session/EncryptedSessionStoreTest.php
@@ -3,8 +3,8 @@ namespace Illuminate\Tests\Session; use Mockery as m; -use PHPUnit\Framework\TestCase; use ReflectionClass; +use PHPUnit\Framework\TestCase; class EncryptedSessionStoreTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Session/SessionStoreTest.php
@@ -3,8 +3,8 @@ namespace Illuminate\Tests\Session; use Mockery as m; -use PHPUnit\Framework\TestCase; use ReflectionClass; +use PHPUnit\Framework\TestCase; class SessionStoreTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Support/SupportArrTest.php
@@ -2,11 +2,11 @@ namespace Illuminate\Tests\Support; +use stdClass; use ArrayObject; use Illuminate\Support\Arr; use PHPUnit\Framework\TestCase; use Illuminate\Support\Collection; -use stdClass; class SupportArrTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Support/SupportCollectionTest.php
@@ -2,16 +2,16 @@ namespace Illuminate\Tests\Support; +use stdClass; use ArrayAccess; -use JsonSerializable; use Mockery as m; +use ReflectionClass; +use JsonSerializable; use PHPUnit\Framework\TestCase; use Illuminate\Support\Collection; +use PHPUnit_Framework_Error_Notice; use Illuminate\Contracts\Support\Jsonable; use Illuminate\Contracts\Support\Arrayable; -use PHPUnit_Framework_Error_Notice; -use ReflectionClass; -use stdClass; class SupportCollectionTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Support/SupportFacadeTest.php
@@ -2,10 +2,10 @@ namespace Illuminate\Tests\Support; +use stdClass; use ArrayAccess; use Mockery as m; use PHPUnit\Framework\TestCase; -use stdClass; class SupportFacadeTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Support/SupportFluentTest.php
@@ -2,10 +2,10 @@ namespace Illuminate\Tests\Support; -use Illuminate\Support\Fluent; +use ReflectionObject; use IteratorAggregate; +use Illuminate\Support\Fluent; use PHPUnit\Framework\TestCase; -use ReflectionObject; class SupportFluentTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/Support/SupportHelpersTest.php
@@ -2,11 +2,11 @@ namespace Illuminate\Tests\Support; +use stdClass; use ArrayAccess; use Mockery as m; use Illuminate\Support\Str; use PHPUnit\Framework\TestCase; -use stdClass; class SupportHelpersTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/View/ViewEngineResolverTest.php
@@ -2,9 +2,9 @@ namespace Illuminate\Tests\View; +use stdClass; use InvalidArgumentException; use PHPUnit\Framework\TestCase; -use stdClass; class ViewEngineResolverTest extends TestCase {
true
Other
laravel
framework
4643459f469038f4fce13a9bab524dc16d5db66b.json
Apply fixes from StyleCI (#17374)
tests/View/ViewFactoryTest.php
@@ -3,9 +3,9 @@ namespace Illuminate\Tests\View; use Mockery as m; +use ReflectionFunction; use Illuminate\View\Factory; use PHPUnit\Framework\TestCase; -use ReflectionFunction; class ViewFactoryTest extends TestCase {
true
Other
laravel
framework
ef43a3cba04ece7d591c5c52b71dc3b5842eb370.json
Remove useless imports. (#17364)
src/Illuminate/Database/Eloquent/Model.php
@@ -8,12 +8,10 @@ use Illuminate\Support\Arr; use Illuminate\Support\Str; use Illuminate\Contracts\Support\Jsonable; -use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Contracts\Routing\UrlRoutable; use Illuminate\Contracts\Queue\QueueableEntity; use Illuminate\Database\Eloquent\Relations\Pivot; -use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Database\Query\Builder as QueryBuilder; use Illuminate\Database\ConnectionResolverInterface as Resolver;
false
Other
laravel
framework
a0bebba5593b4063076f93df228121293ead6d48.json
Handle JSON request (#17369)
src/Illuminate/Foundation/Auth/AuthenticatesUsers.php
@@ -123,11 +123,15 @@ protected function authenticated(Request $request, $user) */ protected function sendFailedLoginResponse(Request $request) { + $errors = [$this->username() => trans('auth.failed')]; + + if ($request->expectsJson()) { + return response()->json($errors, 422); + } + return redirect()->back() ->withInput($request->only($this->username(), 'remember')) - ->withErrors([ - $this->username() => trans('auth.failed'), - ]); + ->withErrors($errors); } /**
true
Other
laravel
framework
a0bebba5593b4063076f93df228121293ead6d48.json
Handle JSON request (#17369)
src/Illuminate/Foundation/Auth/ThrottlesLogins.php
@@ -48,9 +48,15 @@ protected function sendLockoutResponse(Request $request) $message = Lang::get('auth.throttle', ['seconds' => $seconds]); + $errors = [$this->username() => $message]; + + if ($request->expectsJson()) { + return response()->json($errors, 423); + } + return redirect()->back() ->withInput($request->only($this->username(), 'remember')) - ->withErrors([$this->username() => $message]); + ->withErrors($errors); } /**
true
Other
laravel
framework
0b5d13f682fde0b835937ea4bfb78507cfd8828c.json
Apply fixes from StyleCI (#17361)
src/Illuminate/Foundation/Testing/Concerns/InteractsWithSession.php
@@ -2,8 +2,6 @@ namespace Illuminate\Foundation\Testing\Concerns; -use PHPUnit_Framework_Assert as PHPUnit; - trait InteractsWithSession { /**
false
Other
laravel
framework
471f9233037c354b541ea33dacb807b55a44cffc.json
Apply fixes from StyleCI (#17356)
src/Illuminate/Database/Grammar.php
@@ -71,7 +71,7 @@ public function wrap($value, $prefixAlias = false) */ protected function wrapAliasedValue($value, $prefixAlias = false) { - $segments = preg_split( '/\s+as\s+/i', $value ); + $segments = preg_split('/\s+as\s+/i', $value); // If we are wrapping a table we need to prefix the alias with the table prefix // as well in order to generate proper syntax. If this is a column of course
true
Other
laravel
framework
471f9233037c354b541ea33dacb807b55a44cffc.json
Apply fixes from StyleCI (#17356)
tests/Database/DatabaseQueryBuilderTest.php
@@ -68,12 +68,12 @@ public function testAliasWrappingAsWholeConstant() $builder->select('x.y as foo.bar')->from('baz'); $this->assertEquals('select "x"."y" as "foo.bar" from "baz"', $builder->toSql()); } - + public function testAliasWrappingWithSpacesInDatabaseName() { - $builder = $this->getBuilder(); - $builder->select('w x.y.z as foo.bar')->from('baz'); - $this->assertEquals('select "w x"."y"."z" as "foo.bar" from "baz"', $builder->toSql()); + $builder = $this->getBuilder(); + $builder->select('w x.y.z as foo.bar')->from('baz'); + $this->assertEquals('select "w x"."y"."z" as "foo.bar" from "baz"', $builder->toSql()); } public function testAddingSelects()
true
Other
laravel
framework
b3203fcda645b641eb64b920df2962c1f37e5004.json
change exception message
src/Illuminate/View/Concerns/ManagesStacks.php
@@ -47,7 +47,7 @@ public function startPush($section, $content = '') public function stopPush() { if (empty($this->pushStack)) { - throw new InvalidArgumentException('Cannot end a section without first starting one.'); + throw new InvalidArgumentException('Cannot end a push stack without first starting one.'); } return tap(array_pop($this->pushStack), function ($last) {
false
Other
laravel
framework
352095c0209948c83decffdba63eb723c706e91a.json
Remove ambiguity in Exception message (#17350) This message has been copy-pasted from the one for `@endsection`/`@stop` directives. However, in this case, the exception is thrown because an `@endpush` directive has been called without any `@push` being called first. This change updates the Exception message to make it clear that it is related to a Blade stack rather than a section, thus preventing developers to investigate into a wrong direction when debugging.
src/Illuminate/View/Factory.php
@@ -686,7 +686,7 @@ public function startPush($section, $content = '') public function stopPush() { if (empty($this->pushStack)) { - throw new InvalidArgumentException('Cannot end a section without first starting one.'); + throw new InvalidArgumentException('Cannot end a push without first starting one.'); } $last = array_pop($this->pushStack);
false
Other
laravel
framework
8f1798e779da1b2ffd6ed9a57ee0105c34f823d1.json
Remove priority. (#17303)
src/Illuminate/Database/Eloquent/Concerns/HasEvents.php
@@ -18,7 +18,7 @@ trait HasEvents /** * User exposed observable events. * - * These are extra user-defind events observers may subscribe to. + * These are extra user-defined events observers may subscribe to. * * @var array */ @@ -28,10 +28,9 @@ trait HasEvents * Register an observer with the Model. * * @param object|string $class - * @param int $priority * @return void */ - public static function observe($class, $priority = 0) + public static function observe($class) { $instance = new static; @@ -42,7 +41,7 @@ public static function observe($class, $priority = 0) // it into the model's event system, making it convenient to watch these. foreach ($instance->getObservableEvents() as $event) { if (method_exists($class, $event)) { - static::registerModelEvent($event, $className.'@'.$event, $priority); + static::registerModelEvent($event, $className.'@'.$event); } } } @@ -108,15 +107,14 @@ public function removeObservableEvents($observables) * * @param string $event * @param \Closure|string $callback - * @param int $priority * @return void */ - protected static function registerModelEvent($event, $callback, $priority = 0) + protected static function registerModelEvent($event, $callback) { if (isset(static::$dispatcher)) { $name = static::class; - static::$dispatcher->listen("eloquent.{$event}: {$name}", $callback, $priority); + static::$dispatcher->listen("eloquent.{$event}: {$name}", $callback); } } @@ -169,96 +167,88 @@ protected function fireCustomModelEvent($event, $method) * Register a saving model event with the dispatcher. * * @param \Closure|string $callback - * @param int $priority * @return void */ - public static function saving($callback, $priority = 0) + public static function saving($callback) { - static::registerModelEvent('saving', $callback, $priority); + static::registerModelEvent('saving', $callback); } /** * Register a saved model event with the dispatcher. * * @param \Closure|string $callback - * @param int $priority * @return void */ - public static function saved($callback, $priority = 0) + public static function saved($callback) { - static::registerModelEvent('saved', $callback, $priority); + static::registerModelEvent('saved', $callback); } /** * Register an updating model event with the dispatcher. * * @param \Closure|string $callback - * @param int $priority * @return void */ - public static function updating($callback, $priority = 0) + public static function updating($callback) { - static::registerModelEvent('updating', $callback, $priority); + static::registerModelEvent('updating', $callback); } /** * Register an updated model event with the dispatcher. * * @param \Closure|string $callback - * @param int $priority * @return void */ - public static function updated($callback, $priority = 0) + public static function updated($callback) { - static::registerModelEvent('updated', $callback, $priority); + static::registerModelEvent('updated', $callback); } /** * Register a creating model event with the dispatcher. * * @param \Closure|string $callback - * @param int $priority * @return void */ - public static function creating($callback, $priority = 0) + public static function creating($callback) { - static::registerModelEvent('creating', $callback, $priority); + static::registerModelEvent('creating', $callback); } /** * Register a created model event with the dispatcher. * * @param \Closure|string $callback - * @param int $priority * @return void */ - public static function created($callback, $priority = 0) + public static function created($callback) { - static::registerModelEvent('created', $callback, $priority); + static::registerModelEvent('created', $callback); } /** * Register a deleting model event with the dispatcher. * * @param \Closure|string $callback - * @param int $priority * @return void */ - public static function deleting($callback, $priority = 0) + public static function deleting($callback) { - static::registerModelEvent('deleting', $callback, $priority); + static::registerModelEvent('deleting', $callback); } /** * Register a deleted model event with the dispatcher. * * @param \Closure|string $callback - * @param int $priority * @return void */ - public static function deleted($callback, $priority = 0) + public static function deleted($callback) { - static::registerModelEvent('deleted', $callback, $priority); + static::registerModelEvent('deleted', $callback); } /**
true
Other
laravel
framework
8f1798e779da1b2ffd6ed9a57ee0105c34f823d1.json
Remove priority. (#17303)
tests/Database/DatabaseEloquentModelTest.php
@@ -1174,8 +1174,8 @@ public function testCloneModelMakesAFreshCopyOfTheModel() public function testModelObserversCanBeAttachedToModels() { EloquentModelStub::setEventDispatcher($events = m::mock('Illuminate\Contracts\Events\Dispatcher')); - $events->shouldReceive('listen')->once()->with('eloquent.creating: EloquentModelStub', 'EloquentTestObserverStub@creating', 0); - $events->shouldReceive('listen')->once()->with('eloquent.saved: EloquentModelStub', 'EloquentTestObserverStub@saved', 0); + $events->shouldReceive('listen')->once()->with('eloquent.creating: EloquentModelStub', 'EloquentTestObserverStub@creating'); + $events->shouldReceive('listen')->once()->with('eloquent.saved: EloquentModelStub', 'EloquentTestObserverStub@saved'); $events->shouldReceive('forget'); EloquentModelStub::observe(new EloquentTestObserverStub); EloquentModelStub::flushEventListeners(); @@ -1184,8 +1184,8 @@ public function testModelObserversCanBeAttachedToModels() public function testModelObserversCanBeAttachedToModelsWithString() { EloquentModelStub::setEventDispatcher($events = m::mock('Illuminate\Contracts\Events\Dispatcher')); - $events->shouldReceive('listen')->once()->with('eloquent.creating: EloquentModelStub', 'EloquentTestObserverStub@creating', 0); - $events->shouldReceive('listen')->once()->with('eloquent.saved: EloquentModelStub', 'EloquentTestObserverStub@saved', 0); + $events->shouldReceive('listen')->once()->with('eloquent.creating: EloquentModelStub', 'EloquentTestObserverStub@creating'); + $events->shouldReceive('listen')->once()->with('eloquent.saved: EloquentModelStub', 'EloquentTestObserverStub@saved'); $events->shouldReceive('forget'); EloquentModelStub::observe('EloquentTestObserverStub'); EloquentModelStub::flushEventListeners();
true
Other
laravel
framework
3097f597a153437b42559faf297e910d35f349cc.json
Allow chaining of response assertions. (#17330)
src/Illuminate/Foundation/Testing/TestResponse.php
@@ -39,7 +39,7 @@ public static function fromBaseResponse($response) * Assert that the response has the given status code. * * @param int $status - * @return void + * @return $this */ public function assertStatus($status) { @@ -49,13 +49,15 @@ public function assertStatus($status) $actual === $status, "Expected status code {$status} but received {$actual}." ); + + return $this; } /** * Assert whether the response is redirecting to a given URI. * * @param string $uri - * @return void + * @return $this */ public function assertRedirect($uri) { @@ -64,6 +66,8 @@ public function assertRedirect($uri) ); PHPUnit::assertEquals(app('url')->to($uri), $this->headers->get('Location')); + + return $this; } /** @@ -96,11 +100,13 @@ public function assertHeader($headerName, $value = null) * * @param string $cookieName * @param mixed $value - * @return void + * @return $this */ public function assertPlainCookie($cookieName, $value = null) { $this->assertCookie($cookieName, $value, false); + + return $this; } /** @@ -154,11 +160,13 @@ protected function getCookie($cookieName) * Assert that the response is a superset of the given JSON. * * @param array $data - * @return void + * @return $this */ public function assertHasJson(array $data) { PHPUnit::assertArraySubset($data, $this->decodeResponseJson()); + + return $this; } /** @@ -186,7 +194,7 @@ protected function decodeResponseJson() * * @param string|array $key * @param mixed $value - * @return void + * @return $this */ public function assertViewHas($key, $value = null) { @@ -203,13 +211,15 @@ public function assertViewHas($key, $value = null) } else { PHPUnit::assertEquals($value, $this->original->$key); } + + return $this; } /** * Assert that the response view has a given list of bound data. * * @param array $bindings - * @return void + * @return $this */ public function assertViewHasAll(array $bindings) { @@ -220,39 +230,45 @@ public function assertViewHasAll(array $bindings) $this->assertViewHas($key, $value); } } + + return $this; } /** * Assert that the response view is missing a piece of bound data. * * @param string $key - * @return void + * @return $this */ public function assertViewMissing($key) { $this->ensureResponseHasView(); PHPUnit::assertArrayNotHasKey($key, $this->original->getData()); + + return $this; } /** * Ensure that the response has a view as its original content. * - * @return void + * @return $this */ protected function ensureResponseHasView() { if (! isset($this->original) || ! $this->original instanceof View) { return PHPUnit::fail('The response is not a view.'); } + + return $this; } /** * Assert that the session has a given value. * * @param string|array $key * @param mixed $value - * @return void + * @return $this */ public function assertSessionHas($key, $value = null) { @@ -268,13 +284,15 @@ public function assertSessionHas($key, $value = null) } else { PHPUnit::assertEquals($value, app('session.store')->get($key)); } + + return $this; } /** * Assert that the session has a given list of values. * * @param array $bindings - * @return void + * @return $this */ public function assertSessionHasAll(array $bindings) { @@ -285,13 +303,15 @@ public function assertSessionHasAll(array $bindings) $this->assertSessionHas($key, $value); } } + + return $this; } /** * Assert that the session does not have a given key. * * @param string|array $key - * @return void + * @return $this */ public function assertSessionMissing($key) { @@ -305,6 +325,8 @@ public function assertSessionMissing($key) "Session has unexpected key [{$key}]." ); } + + return $this; } /**
false
Other
laravel
framework
0fd8f8de75545b5701e59f51c88d02c12528800a.json
Add broadcast method to trait.
src/Illuminate/Foundation/Events/Dispatchable.php
@@ -13,4 +13,14 @@ public static function dispatch() { return event(new static(...func_get_args())); } + + /** + * Broadcast the event with the given arguments. + * + * @return \Illuminate\Broadcasting\PendingBroadcast + */ + public static function broadcast() + { + return broadcast(new static(...func_get_args())); + } }
false
Other
laravel
framework
9c4cf333158e9b00e58888686b65c55774de8fdc.json
Apply fixes from StyleCI (#17327)
src/Illuminate/View/Factory.php
@@ -5,7 +5,6 @@ use Illuminate\Support\Arr; use Illuminate\Support\Str; use InvalidArgumentException; -use Illuminate\Support\Collection; use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Support\Arrayable; use Illuminate\View\Engines\EngineResolver; @@ -171,6 +170,7 @@ public function renderEach($view, $data, $iterator, $empty = 'raw|') $result = $this->make($empty)->render(); } } + return $result; }
false
Other
laravel
framework
ac3d11e2a0d7d794adcdde648a27594a4153f6e9.json
Apply fixes from StyleCI (#17278)
src/Illuminate/Database/Connectors/Connector.php
@@ -36,7 +36,7 @@ class Connector public function createConnection($dsn, array $config, array $options) { list($username, $password) = [ - Arr::get($config, 'username'), Arr::get($config, 'password') + Arr::get($config, 'username'), Arr::get($config, 'password'), ]; try {
false
Other
laravel
framework
a2749017ef461dd4f0843bc73c826ce55a5fd63f.json
Fix undefined variable hosts (#17272)
src/Illuminate/Database/Connectors/ConnectionFactory.php
@@ -175,7 +175,7 @@ protected function createPdoResolver(array $config) protected function createPdoResolverWithHosts(array $config) { return function () use ($config) { - foreach (Arr::shuffle($this->parseHosts($config)) as $key => $host) { + foreach (Arr::shuffle($hosts = $this->parseHosts($config)) as $key => $host) { $config['host'] = $host; try {
false
Other
laravel
framework
09ffc3a2eeddd31d43e1121ae865dd37e16f0cef.json
Fix assertCookie (#17271)
src/Illuminate/Foundation/Testing/TestResponse.php
@@ -6,6 +6,7 @@ use Illuminate\Http\Response; use Illuminate\Contracts\View\View; use PHPUnit_Framework_Assert as PHPUnit; +use Symfony\Component\HttpFoundation\Cookie; class TestResponse extends Response { @@ -108,16 +109,16 @@ public function assertPlainCookie($cookieName, $value = null) * @param string $cookieName * @param mixed $value * @param bool $encrypted - * @return void + * @return $this */ public function assertCookie($cookieName, $value = null, $encrypted = true) { - PHPUnit::assertTrue( - $exists = $this->hasCookie($cookieName), + PHPUnit::assertNotNull( + $cookie = $this->getCookie($cookieName), "Cookie [{$cookieName}] not present on response." ); - if (! $exists || is_null($value)) { + if (! $cookie || is_null($value)) { return $this; } @@ -130,23 +131,23 @@ public function assertCookie($cookieName, $value = null, $encrypted = true) $actual, $value, "Cookie [{$cookieName}] was found, but value [{$actual}] does not match [{$value}]." ); + + return $this; } /** - * Determine if the response has a given cookie. + * Get the given cookie from the response. * * @param string $cookieName - * @return bool + * @return Cookie|null */ - protected function hasCookie($cookieName) + protected function getCookie($cookieName) { foreach ($this->headers->getCookies() as $cookie) { if ($cookie->getName() === $cookieName) { - return true; + return $cookie; } } - - return false; } /**
false
Other
laravel
framework
7464dce14d76071d6b9f6056f96d7983528bc6ee.json
Fix multiple unused variables (#17274)
src/Illuminate/Database/Eloquent/Builder.php
@@ -951,7 +951,7 @@ protected function callScope(callable $scope, $parameters = []) $this->addNewWheresWithinGroup($query, $originalWhereCount); } - return $this; + return $result; } /**
true
Other
laravel
framework
7464dce14d76071d6b9f6056f96d7983528bc6ee.json
Fix multiple unused variables (#17274)
src/Illuminate/Queue/Console/WorkCommand.php
@@ -80,7 +80,7 @@ public function fire() // connection being run for the queue operation currently being executed. $queue = $this->getQueue($connection); - $response = $this->runWorker( + $this->runWorker( $connection, $queue ); }
true
Other
laravel
framework
7464dce14d76071d6b9f6056f96d7983528bc6ee.json
Fix multiple unused variables (#17274)
src/Illuminate/View/Concerns/ManagesComponents.php
@@ -101,7 +101,7 @@ public function slot($name) */ public function endSlot() { - $current = last($this->componentStack); + last($this->componentStack); $currentSlot = array_pop( $this->slotStack[$this->currentComponent()]
true
Other
laravel
framework
7464dce14d76071d6b9f6056f96d7983528bc6ee.json
Fix multiple unused variables (#17274)
src/Illuminate/View/Factory.php
@@ -149,23 +149,17 @@ public function make($view, $data = [], $mergeData = []) */ public function renderEach($view, $data, $iterator, $empty = 'raw|') { - $result = ''; - // If is actually data in the array, we will loop through the data and append // an instance of the partial view to the final result HTML passing in the // iterated value of this data array, allowing the views to access them. if (count($data) > 0) { - $result = $this->renderEachView($view, $data, $iterator); + return $this->renderEachView($view, $data, $iterator); } // If there is no data in the array, we will render the contents of the empty // 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 { - return $this->renderEmptyEach($empty); - } - - return $result; + return $this->renderEmptyEach($empty); } /**
true
Other
laravel
framework
52777eecdca8fbafe4ea07498953aabb548481f2.json
Fix undefined variables
src/Illuminate/Database/Connectors/Connector.php
@@ -41,7 +41,7 @@ public function createConnection($dsn, array $config, array $options) ); } catch (Exception $e) { return $this->tryAgainIfCausedByLostConnection( - $e, $dsn, $username, $password, $options + $e, $dsn, Arr::get($config, 'username'), Arr::get($config, 'password'), $options ); } }
false
Other
laravel
framework
73669ec79a91f59ebfc53ff829f3c62ba2c9e591.json
Apply fixes from StyleCI (#17258)
tests/Events/EventsDispatcherTest.php
@@ -28,6 +28,7 @@ public function testHaltingEventExecution() $d = new Dispatcher; $d->listen('foo', function ($foo) { $this->assertTrue(true); + return 'here'; }); $d->listen('foo', function ($foo) {
false
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
src/Illuminate/Auth/SessionGuard.php
@@ -491,7 +491,7 @@ public function logout() } if (isset($this->events)) { - $this->events->fire(new Events\Logout($user)); + $this->events->dispatch(new Events\Logout($user)); } // Once we have fired the logout event we will clear the users out of memory @@ -553,7 +553,7 @@ public function attempting($callback) protected function fireAttemptEvent(array $credentials, $remember = false) { if (isset($this->events)) { - $this->events->fire(new Events\Attempting( + $this->events->dispatch(new Events\Attempting( $credentials, $remember )); } @@ -569,7 +569,7 @@ protected function fireAttemptEvent(array $credentials, $remember = false) protected function fireLoginEvent($user, $remember = false) { if (isset($this->events)) { - $this->events->fire(new Events\Login($user, $remember)); + $this->events->dispatch(new Events\Login($user, $remember)); } } @@ -582,7 +582,7 @@ protected function fireLoginEvent($user, $remember = false) protected function fireAuthenticatedEvent($user) { if (isset($this->events)) { - $this->events->fire(new Events\Authenticated($user)); + $this->events->dispatch(new Events\Authenticated($user)); } } @@ -596,7 +596,7 @@ protected function fireAuthenticatedEvent($user) protected function fireFailedEvent($user, array $credentials) { if (isset($this->events)) { - $this->events->fire(new Events\Failed($user, $credentials)); + $this->events->dispatch(new Events\Failed($user, $credentials)); } }
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
src/Illuminate/Broadcasting/PendingBroadcast.php
@@ -54,6 +54,6 @@ public function toOthers() */ public function __destruct() { - $this->events->fire($this->event); + $this->events->dispatch($this->event); } }
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
src/Illuminate/Cache/Repository.php
@@ -418,7 +418,7 @@ public function getStore() protected function event($event) { if (isset($this->events)) { - $this->events->fire($event); + $this->events->dispatch($event); } }
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
src/Illuminate/Console/Application.php
@@ -53,7 +53,7 @@ public function __construct(Container $laravel, Dispatcher $events, $version) $this->setAutoExit(false); $this->setCatchExceptions(false); - $events->fire(new Events\ArtisanStarting($this)); + $events->dispatch(new Events\ArtisanStarting($this)); $this->bootstrap(); }
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
src/Illuminate/Database/Connection.php
@@ -780,11 +780,11 @@ protected function fireConnectionEvent($event) switch ($event) { case 'beganTransaction': - return $this->events->fire(new Events\TransactionBeginning($this)); + return $this->events->dispatch(new Events\TransactionBeginning($this)); case 'committed': - return $this->events->fire(new Events\TransactionCommitted($this)); + return $this->events->dispatch(new Events\TransactionCommitted($this)); case 'rollingBack': - return $this->events->fire(new Events\TransactionRolledBack($this)); + return $this->events->dispatch(new Events\TransactionRolledBack($this)); } } @@ -797,7 +797,7 @@ protected function fireConnectionEvent($event) protected function event($event) { if (isset($this->events)) { - $this->events->fire($event); + $this->events->dispatch($event); } }
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
src/Illuminate/Events/Dispatcher.php
@@ -103,7 +103,7 @@ public function hasListeners($eventName) public function push($event, $payload = []) { $this->listen($event.'_pushed', function () use ($event, $payload) { - $this->fire($event, $payload); + $this->dispatch($event, $payload); }); } @@ -143,7 +143,7 @@ protected function resolveSubscriber($subscriber) */ public function flush($event) { - $this->fire($event.'_pushed'); + $this->dispatch($event.'_pushed'); } /** @@ -154,18 +154,6 @@ public function flush($event) * @return array|null */ public function dispatch($event, $payload = []) - { - return $this->fire($event, $payload); - } - - /** - * Fire an event and call the listeners. - * - * @param string|object $event - * @param mixed $payload - * @return array|null - */ - public function fire($event, $payload = []) { // When the given "event" is actually an object we will assume it is an event // object and use the class as the event name and this event itself as the @@ -196,6 +184,18 @@ public function fire($event, $payload = []) return $responses; } + /** + * Fire an event and call the listeners. + * + * @param string|object $event + * @param mixed $payload + * @return array|null + */ + public function fire($event, $payload = []) + { + return $this->dispatch($event, $payload); + } + /** * Parse the given event and payload and prepare them for dispatching. *
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
src/Illuminate/Log/Writer.php
@@ -293,7 +293,7 @@ protected function fireLogEvent($level, $message, array $context = []) // log listeners. These are useful for building profilers or other tools // that aggregate all of the log messages for a given "request" cycle. if (isset($this->dispatcher)) { - $this->dispatcher->fire(new MessageLogged($level, $message, $context)); + $this->dispatcher->dispatch(new MessageLogged($level, $message, $context)); } }
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
src/Illuminate/Mail/Mailer.php
@@ -416,7 +416,7 @@ protected function createMessage() protected function sendSwiftMessage($message) { if ($this->events) { - $this->events->fire(new Events\MessageSending($message)); + $this->events->dispatch(new Events\MessageSending($message)); } try {
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
src/Illuminate/Notifications/Channels/BroadcastChannel.php
@@ -48,7 +48,7 @@ public function send($notifiable, Notification $notification) ->onQueue($message->queue); } - return $this->events->fire($event); + return $this->events->dispatch($event); } /**
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
src/Illuminate/Notifications/NotificationSender.php
@@ -111,7 +111,7 @@ protected function sendToNotifiable($notifiable, $id, $notification, $channel) $response = $this->manager->driver($channel)->send($notifiable, $notification); - $this->events->fire( + $this->events->dispatch( new Events\NotificationSent($notifiable, $notification, $channel, $response) ); }
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
src/Illuminate/Routing/Router.php
@@ -516,7 +516,7 @@ public function dispatchToRoute(Request $request) return $route; }); - $this->events->fire(new Events\RouteMatched($route, $request)); + $this->events->dispatch(new Events\RouteMatched($route, $request)); $response = $this->runRouteWithinStack($route, $request);
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
tests/Auth/AuthGuardTest.php
@@ -68,8 +68,8 @@ public function testAttemptCallsRetrieveByCredentials() { $guard = $this->getGuard(); $guard->setDispatcher($events = m::mock('Illuminate\Contracts\Events\Dispatcher')); - $events->shouldReceive('fire')->once()->with(m::type(Attempting::class)); - $events->shouldReceive('fire')->once()->with(m::type(Failed::class)); + $events->shouldReceive('dispatch')->once()->with(m::type(Attempting::class)); + $events->shouldReceive('dispatch')->once()->with(m::type(Failed::class)); $guard->getProvider()->shouldReceive('retrieveByCredentials')->once()->with(['foo']); $guard->attempt(['foo']); } @@ -79,7 +79,7 @@ public function testAttemptReturnsUserInterface() list($session, $provider, $request, $cookie) = $this->getMocks(); $guard = $this->getMockBuilder('Illuminate\Auth\SessionGuard')->setMethods(['login'])->setConstructorArgs(['default', $provider, $session, $request])->getMock(); $guard->setDispatcher($events = m::mock('Illuminate\Contracts\Events\Dispatcher')); - $events->shouldReceive('fire')->once()->with(m::type(Attempting::class)); + $events->shouldReceive('dispatch')->once()->with(m::type(Attempting::class)); $user = $this->createMock('Illuminate\Contracts\Auth\Authenticatable'); $guard->getProvider()->shouldReceive('retrieveByCredentials')->once()->andReturn($user); $guard->getProvider()->shouldReceive('validateCredentials')->with($user, ['foo'])->andReturn(true); @@ -91,8 +91,8 @@ public function testAttemptReturnsFalseIfUserNotGiven() { $mock = $this->getGuard(); $mock->setDispatcher($events = m::mock('Illuminate\Contracts\Events\Dispatcher')); - $events->shouldReceive('fire')->once()->with(m::type(Attempting::class)); - $events->shouldReceive('fire')->once()->with(m::type(Failed::class)); + $events->shouldReceive('dispatch')->once()->with(m::type(Attempting::class)); + $events->shouldReceive('dispatch')->once()->with(m::type(Failed::class)); $mock->getProvider()->shouldReceive('retrieveByCredentials')->once()->andReturn(null); $this->assertFalse($mock->attempt(['foo'])); } @@ -115,8 +115,8 @@ public function testLoginFiresLoginAndAuthenticatedEvents() $mock = $this->getMockBuilder('Illuminate\Auth\SessionGuard')->setMethods(['getName'])->setConstructorArgs(['default', $provider, $session, $request])->getMock(); $mock->setDispatcher($events = m::mock('Illuminate\Contracts\Events\Dispatcher')); $user = m::mock('Illuminate\Contracts\Auth\Authenticatable'); - $events->shouldReceive('fire')->once()->with(m::type('Illuminate\Auth\Events\Login')); - $events->shouldReceive('fire')->once()->with(m::type('Illuminate\Auth\Events\Authenticated')); + $events->shouldReceive('dispatch')->once()->with(m::type('Illuminate\Auth\Events\Login')); + $events->shouldReceive('dispatch')->once()->with(m::type('Illuminate\Auth\Events\Authenticated')); $mock->expects($this->once())->method('getName')->will($this->returnValue('foo')); $user->shouldReceive('getAuthIdentifier')->once()->andReturn('bar'); $mock->getSession()->shouldReceive('put')->with('foo', 'bar')->once(); @@ -128,8 +128,8 @@ public function testFailedAttemptFiresFailedEvent() { $guard = $this->getGuard(); $guard->setDispatcher($events = m::mock('Illuminate\Contracts\Events\Dispatcher')); - $events->shouldReceive('fire')->once()->with(m::type(Attempting::class)); - $events->shouldReceive('fire')->once()->with(m::type(Failed::class)); + $events->shouldReceive('dispatch')->once()->with(m::type(Attempting::class)); + $events->shouldReceive('dispatch')->once()->with(m::type(Failed::class)); $guard->getProvider()->shouldReceive('retrieveByCredentials')->once()->with(['foo'])->andReturn(null); $guard->attempt(['foo']); } @@ -147,7 +147,7 @@ public function testSetUserFiresAuthenticatedEvent() $user = m::mock('Illuminate\Contracts\Auth\Authenticatable'); $guard = $this->getGuard(); $guard->setDispatcher($events = m::mock('Illuminate\Contracts\Events\Dispatcher')); - $events->shouldReceive('fire')->once()->with(m::type(Authenticated::class)); + $events->shouldReceive('dispatch')->once()->with(m::type(Authenticated::class)); $guard->setUser($user); } @@ -252,9 +252,9 @@ public function testLogoutFiresLogoutEvent() $user = m::mock('Illuminate\Contracts\Auth\Authenticatable'); $user->shouldReceive('setRememberToken')->once(); $provider->shouldReceive('updateRememberToken')->once(); - $events->shouldReceive('fire')->once()->with(m::type(Authenticated::class)); + $events->shouldReceive('dispatch')->once()->with(m::type(Authenticated::class)); $mock->setUser($user); - $events->shouldReceive('fire')->once()->with(m::type('Illuminate\Auth\Events\Logout')); + $events->shouldReceive('dispatch')->once()->with(m::type('Illuminate\Auth\Events\Logout')); $mock->logout(); }
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
tests/Cache/CacheEventsTest.php
@@ -19,16 +19,16 @@ public function testHasTriggersEvents() $dispatcher = $this->getDispatcher(); $repository = $this->getRepository($dispatcher); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo'])); $this->assertFalse($repository->has('foo')); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheHit::class, ['key' => 'baz', 'value' => 'qux'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheHit::class, ['key' => 'baz', 'value' => 'qux'])); $this->assertTrue($repository->has('baz')); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo', 'tags' => ['taylor']])); $this->assertFalse($repository->tags('taylor')->has('foo')); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheHit::class, ['key' => 'baz', 'value' => 'qux', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheHit::class, ['key' => 'baz', 'value' => 'qux', 'tags' => ['taylor']])); $this->assertTrue($repository->tags('taylor')->has('baz')); } @@ -37,16 +37,16 @@ public function testGetTriggersEvents() $dispatcher = $this->getDispatcher(); $repository = $this->getRepository($dispatcher); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo'])); $this->assertNull($repository->get('foo')); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheHit::class, ['key' => 'baz', 'value' => 'qux'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheHit::class, ['key' => 'baz', 'value' => 'qux'])); $this->assertEquals('qux', $repository->get('baz')); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo', 'tags' => ['taylor']])); $this->assertNull($repository->tags('taylor')->get('foo')); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheHit::class, ['key' => 'baz', 'value' => 'qux', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheHit::class, ['key' => 'baz', 'value' => 'qux', 'tags' => ['taylor']])); $this->assertEquals('qux', $repository->tags('taylor')->get('baz')); } @@ -55,8 +55,8 @@ public function testPullTriggersEvents() $dispatcher = $this->getDispatcher(); $repository = $this->getRepository($dispatcher); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheHit::class, ['key' => 'baz', 'value' => 'qux'])); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(KeyForgotten::class, ['key' => 'baz'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheHit::class, ['key' => 'baz', 'value' => 'qux'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(KeyForgotten::class, ['key' => 'baz'])); $this->assertEquals('qux', $repository->pull('baz')); } @@ -65,8 +65,8 @@ public function testPullTriggersEventsUsingTags() $dispatcher = $this->getDispatcher(); $repository = $this->getRepository($dispatcher); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheHit::class, ['key' => 'baz', 'value' => 'qux', 'tags' => ['taylor']])); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(KeyForgotten::class, ['key' => 'baz', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheHit::class, ['key' => 'baz', 'value' => 'qux', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(KeyForgotten::class, ['key' => 'baz', 'tags' => ['taylor']])); $this->assertEquals('qux', $repository->tags('taylor')->pull('baz')); } @@ -75,10 +75,10 @@ public function testPutTriggersEvents() $dispatcher = $this->getDispatcher(); $repository = $this->getRepository($dispatcher); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar'])); $repository->put('foo', 'bar', 99); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar', 'tags' => ['taylor']])); $repository->tags('taylor')->put('foo', 'bar', 99); } @@ -87,12 +87,12 @@ public function testAddTriggersEvents() $dispatcher = $this->getDispatcher(); $repository = $this->getRepository($dispatcher); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo'])); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar'])); $this->assertTrue($repository->add('foo', 'bar', 99)); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo', 'tags' => ['taylor']])); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar', 'tags' => ['taylor']])); $this->assertTrue($repository->tags('taylor')->add('foo', 'bar', 99)); } @@ -101,10 +101,10 @@ public function testForeverTriggersEvents() $dispatcher = $this->getDispatcher(); $repository = $this->getRepository($dispatcher); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar'])); $repository->forever('foo', 'bar'); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar', 'tags' => ['taylor']])); $repository->tags('taylor')->forever('foo', 'bar'); } @@ -113,14 +113,14 @@ public function testRememberTriggersEvents() $dispatcher = $this->getDispatcher(); $repository = $this->getRepository($dispatcher); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo'])); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar'])); $this->assertEquals('bar', $repository->remember('foo', 99, function () { return 'bar'; })); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo', 'tags' => ['taylor']])); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar', 'tags' => ['taylor']])); $this->assertEquals('bar', $repository->tags('taylor')->remember('foo', 99, function () { return 'bar'; })); @@ -131,14 +131,14 @@ public function testRememberForeverTriggersEvents() $dispatcher = $this->getDispatcher(); $repository = $this->getRepository($dispatcher); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo'])); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar'])); $this->assertEquals('bar', $repository->rememberForever('foo', function () { return 'bar'; })); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo', 'tags' => ['taylor']])); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(CacheMissed::class, ['key' => 'foo', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(KeyWritten::class, ['key' => 'foo', 'value' => 'bar', 'tags' => ['taylor']])); $this->assertEquals('bar', $repository->tags('taylor')->rememberForever('foo', function () { return 'bar'; })); @@ -149,10 +149,10 @@ public function testForgetTriggersEvents() $dispatcher = $this->getDispatcher(); $repository = $this->getRepository($dispatcher); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(KeyForgotten::class, ['key' => 'baz'])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(KeyForgotten::class, ['key' => 'baz'])); $this->assertTrue($repository->forget('baz')); - $dispatcher->shouldReceive('fire')->once()->with($this->assertEventMatches(KeyForgotten::class, ['key' => 'baz', 'tags' => ['taylor']])); + $dispatcher->shouldReceive('dispatch')->once()->with($this->assertEventMatches(KeyForgotten::class, ['key' => 'baz', 'tags' => ['taylor']])); $this->assertTrue($repository->tags('taylor')->forget('baz')); }
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
tests/Console/ConsoleApplicationTest.php
@@ -46,7 +46,7 @@ public function testResolveAddsCommandViaApplicationResolution() protected function getMockConsole(array $methods) { $app = m::mock('Illuminate\Contracts\Foundation\Application', ['version' => '5.4']); - $events = m::mock('Illuminate\Contracts\Events\Dispatcher', ['fire' => null]); + $events = m::mock('Illuminate\Contracts\Events\Dispatcher', ['dispatch' => null]); $console = $this->getMockBuilder('Illuminate\Console\Application')->setMethods($methods)->setConstructorArgs([ $app, $events, 'test-version',
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
tests/Database/DatabaseConnectionTest.php
@@ -173,7 +173,7 @@ public function testBeganTransactionFiresEventsIfSet() $connection = $this->getMockConnection(['getName'], $pdo); $connection->expects($this->any())->method('getName')->will($this->returnValue('name')); $connection->setEventDispatcher($events = m::mock('Illuminate\Contracts\Events\Dispatcher')); - $events->shouldReceive('fire')->once()->with(m::type('Illuminate\Database\Events\TransactionBeginning')); + $events->shouldReceive('dispatch')->once()->with(m::type('Illuminate\Database\Events\TransactionBeginning')); $connection->beginTransaction(); } @@ -183,7 +183,7 @@ public function testCommitedFiresEventsIfSet() $connection = $this->getMockConnection(['getName'], $pdo); $connection->expects($this->any())->method('getName')->will($this->returnValue('name')); $connection->setEventDispatcher($events = m::mock('Illuminate\Contracts\Events\Dispatcher')); - $events->shouldReceive('fire')->once()->with(m::type('Illuminate\Database\Events\TransactionCommitted')); + $events->shouldReceive('dispatch')->once()->with(m::type('Illuminate\Database\Events\TransactionCommitted')); $connection->commit(); } @@ -194,7 +194,7 @@ public function testRollBackedFiresEventsIfSet() $connection->expects($this->any())->method('getName')->will($this->returnValue('name')); $connection->beginTransaction(); $connection->setEventDispatcher($events = m::mock('Illuminate\Contracts\Events\Dispatcher')); - $events->shouldReceive('fire')->once()->with(m::type('Illuminate\Database\Events\TransactionRolledBack')); + $events->shouldReceive('dispatch')->once()->with(m::type('Illuminate\Database\Events\TransactionRolledBack')); $connection->rollBack(); } @@ -204,7 +204,7 @@ public function testRedundantRollBackFiresNoEvent() $connection = $this->getMockConnection(['getName'], $pdo); $connection->expects($this->any())->method('getName')->will($this->returnValue('name')); $connection->setEventDispatcher($events = m::mock('Illuminate\Contracts\Events\Dispatcher')); - $events->shouldNotReceive('fire'); + $events->shouldNotReceive('dispatch'); $connection->rollBack(); } @@ -351,7 +351,7 @@ public function testLogQueryFiresEventsIfSet() $connection = $this->getMockConnection(); $connection->logQuery('foo', [], time()); $connection->setEventDispatcher($events = m::mock('Illuminate\Contracts\Events\Dispatcher')); - $events->shouldReceive('fire')->once()->with(m::type('Illuminate\Database\Events\QueryExecuted')); + $events->shouldReceive('dispatch')->once()->with(m::type('Illuminate\Database\Events\QueryExecuted')); $connection->logQuery('foo', [], null); }
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
tests/Notifications/NotificationBroadcastChannelTest.php
@@ -19,7 +19,7 @@ public function testDatabaseChannelCreatesDatabaseRecordWithProperData() $notifiable = Mockery::mock(); $events = Mockery::mock('Illuminate\Contracts\Events\Dispatcher'); - $events->shouldReceive('fire')->once()->with(Mockery::type('Illuminate\Notifications\Events\BroadcastNotificationCreated')); + $events->shouldReceive('dispatch')->once()->with(Mockery::type('Illuminate\Notifications\Events\BroadcastNotificationCreated')); $channel = new BroadcastChannel($events); $channel->send($notifiable, $notification); } @@ -46,7 +46,7 @@ public function testNotificationIsBroadcastedNow() $notifiable = Mockery::mock(); $events = Mockery::mock('Illuminate\Contracts\Events\Dispatcher'); - $events->shouldReceive('fire')->once()->with(Mockery::on(function ($event) { + $events->shouldReceive('dispatch')->once()->with(Mockery::on(function ($event) { return $event->connection == 'sync'; })); $channel = new BroadcastChannel($events);
true
Other
laravel
framework
5e98a2ce90530847f11a3d8ed7e73d9fea6acc14.json
Use dispatch instead of fire (#17246)
tests/Notifications/NotificationChannelManagerTest.php
@@ -25,7 +25,7 @@ public function testNotificationCanBeDispatchedToDriver() $manager->shouldReceive('driver')->andReturn($driver = Mockery::mock()); $events->shouldReceive('until')->with(Mockery::type(Illuminate\Notifications\Events\NotificationSending::class))->andReturn(true); $driver->shouldReceive('send')->once(); - $events->shouldReceive('fire')->with(Mockery::type(Illuminate\Notifications\Events\NotificationSent::class)); + $events->shouldReceive('dispatch')->with(Mockery::type(Illuminate\Notifications\Events\NotificationSent::class)); $manager->send(new NotificationChannelManagerTestNotifiable, new NotificationChannelManagerTestNotification); } @@ -42,7 +42,7 @@ public function testNotificationNotSentOnHalt() $events->shouldReceive('until')->with(Mockery::type(Illuminate\Notifications\Events\NotificationSending::class))->andReturn(true); $manager->shouldReceive('driver')->once()->andReturn($driver = Mockery::mock()); $driver->shouldReceive('send')->once(); - $events->shouldReceive('fire')->with(Mockery::type(Illuminate\Notifications\Events\NotificationSent::class)); + $events->shouldReceive('dispatch')->with(Mockery::type(Illuminate\Notifications\Events\NotificationSent::class)); $manager->send([new NotificationChannelManagerTestNotifiable], new NotificationChannelManagerTestNotificationWithTwoChannels); }
true
Other
laravel
framework
24cc767f9ff3a83c01620d2b05ab976bb128b6e2.json
Apply fixes from StyleCI (#17252)
src/Illuminate/Routing/RouteUrlGenerator.php
@@ -71,7 +71,7 @@ public function __construct($url, $request) * @param array $parameters * @param bool $absolute * @return string - * + * * @throws UrlGenerationException */ public function to($route, $parameters = [], $absolute = false)
false
Other
laravel
framework
fc7d27ae0331b6d37cba3a1d5879d8f4247cf89f.json
Update some docblocks (#17251)
src/Illuminate/Database/Concerns/ManagesTransactions.php
@@ -53,6 +53,8 @@ public function transaction(Closure $callback, $attempts = 1) * @param int $currentAttempt * @param int $maxAttempts * @return void + * + * @throws \Exception */ protected function handleTransactionException($e, $currentAttempt, $maxAttempts) { @@ -129,6 +131,8 @@ protected function createSavepoint() * * @param \Exception $e * @return void + * + * @throws Exception */ protected function handleBeginTransactionException($e) {
true
Other
laravel
framework
fc7d27ae0331b6d37cba3a1d5879d8f4247cf89f.json
Update some docblocks (#17251)
src/Illuminate/Routing/RouteUrlGenerator.php
@@ -67,11 +67,12 @@ public function __construct($url, $request) /** * Generate a URL for the given route. * - * @param \Illuminate\Routing\UrlGeneartor $url * @param \Illuminate\Routing\Route $route * @param array $parameters * @param bool $absolute * @return string + * + * @throws UrlGenerationException */ public function to($route, $parameters = [], $absolute = false) {
true
Other
laravel
framework
fc7d27ae0331b6d37cba3a1d5879d8f4247cf89f.json
Update some docblocks (#17251)
src/Illuminate/Support/Collection.php
@@ -1459,6 +1459,8 @@ public static function proxy($method) * * @param string $key * @return mixed + * + * @throws Exception */ public function __get($key) {
true
Other
laravel
framework
fc7d27ae0331b6d37cba3a1d5879d8f4247cf89f.json
Update some docblocks (#17251)
src/Illuminate/Support/helpers.php
@@ -627,6 +627,8 @@ function preg_replace_array($pattern, array $replacements, $subject) * @param callable $callback * @param int $sleep * @return mixed + * + * @throws Exception */ function retry($times, callable $callback, $sleep = 0) {
true