Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Illuminate/Collections/LazyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ public function chunkWhile(callable $callback)
return new static(function () use ($callback) {
$iterator = $this->getIterator();

$chunk = new Collection();
$chunk = new Collection;

if ($iterator->valid()) {
$chunk[$iterator->key()] = $iterator->current();
Expand All @@ -1083,7 +1083,7 @@ public function chunkWhile(callable $callback)
if (! $callback($iterator->current(), $iterator->key(), $chunk)) {
yield new static($chunk);

$chunk = new Collection();
$chunk = new Collection;
}

$chunk[$iterator->key()] = $iterator->current();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ protected function registerEventClearCommand()
protected function registerEventListCommand()
{
$this->app->singleton('command.event.list', function () {
return new EventListCommand();
return new EventListCommand;
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Http/Testing/MimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MimeType
public static function getMimeTypes()
{
if (self::$mime === null) {
self::$mime = new MimeTypes();
self::$mime = new MimeTypes;
}

return self::$mime;
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Mail/MailManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ protected function createPostmarkTransport(array $config)
$config['token'] ?? $this->app['config']->get('services.postmark.token'),
$headers
), function ($transport) {
$transport->registerPlugin(new ThrowExceptionOnFailurePlugin());
$transport->registerPlugin(new ThrowExceptionOnFailurePlugin);
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ public static function orderedUuid()
return call_user_func(static::$uuidFactory);
}

$factory = new UuidFactory();
$factory = new UuidFactory;

$factory->setRandomGenerator(new CombGenerator(
$factory->getRandomGenerator(),
Expand Down
12 changes: 6 additions & 6 deletions src/Illuminate/Validation/Concerns/ValidatesAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -617,23 +617,23 @@ public function validateEmail($attribute, $value, $parameters)
->unique()
->map(function ($validation) {
if ($validation === 'rfc') {
return new RFCValidation();
return new RFCValidation;
} elseif ($validation === 'strict') {
return new NoRFCWarningsValidation();
return new NoRFCWarningsValidation;
} elseif ($validation === 'dns') {
return new DNSCheckValidation();
return new DNSCheckValidation;
} elseif ($validation === 'spoof') {
return new SpoofCheckValidation();
return new SpoofCheckValidation;
} elseif ($validation === 'filter') {
return new FilterEmailValidation();
return new FilterEmailValidation;
} elseif ($validation === 'filter_unicode') {
return FilterEmailValidation::unicode();
} elseif (is_string($validation) && class_exists($validation)) {
return $this->container->make($validation);
}
})
->values()
->all() ?: [new RFCValidation()];
->all() ?: [new RFCValidation];

return (new EmailValidator)->isValid($value, new MultipleValidationWithAnd($validations));
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Broadcasting/UsePusherChannelsNamesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class UsePusherChannelsNamesTest extends TestCase
*/
public function testChannelNameNormalization($requestChannelName, $normalizedName)
{
$broadcaster = new FakeBroadcasterUsingPusherChannelsNames();
$broadcaster = new FakeBroadcasterUsingPusherChannelsNames;

$this->assertSame(
$normalizedName,
Expand All @@ -23,7 +23,7 @@ public function testChannelNameNormalization($requestChannelName, $normalizedNam

public function testChannelNameNormalizationSpecialCase()
{
$broadcaster = new FakeBroadcasterUsingPusherChannelsNames();
$broadcaster = new FakeBroadcasterUsingPusherChannelsNames;

$this->assertSame(
'private-123',
Expand All @@ -36,7 +36,7 @@ public function testChannelNameNormalizationSpecialCase()
*/
public function testIsGuardedChannel($requestChannelName, $_, $guarded)
{
$broadcaster = new FakeBroadcasterUsingPusherChannelsNames();
$broadcaster = new FakeBroadcasterUsingPusherChannelsNames;

$this->assertSame(
$guarded,
Expand Down
6 changes: 3 additions & 3 deletions tests/Bus/BusBatchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,11 @@ public function test_chain_can_be_added_to_batch()

$batch = $this->createTestBatch($queue);

$chainHeadJob = new ChainHeadJob();
$chainHeadJob = new ChainHeadJob;

$secondJob = new SecondTestJob();
$secondJob = new SecondTestJob;

$thirdJob = new ThirdTestJob();
$thirdJob = new ThirdTestJob;

$queue->shouldReceive('connection')->once()
->with('test-connection')
Expand Down
4 changes: 2 additions & 2 deletions tests/Cache/CacheManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testForgetDriver()
$cacheManager->shouldReceive('resolve')
->withArgs(['array'])
->times(4)
->andReturn(new ArrayStore());
->andReturn(new ArrayStore);

$cacheManager->shouldReceive('getDefaultDriver')
->once()
Expand All @@ -64,7 +64,7 @@ public function testForgetDriverForgets()
],
]);
$cacheManager->extend('forget', function () {
return new ArrayStore();
return new ArrayStore;
});

$cacheManager->store('forget')->forever('foo', 'bar');
Expand Down
4 changes: 2 additions & 2 deletions tests/Console/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function handle()
$command->setLaravel($application);

$input = new ArrayInput([]);
$output = new NullOutput();
$output = new NullOutput;
$application->shouldReceive('make')->with(OutputStyle::class, ['input' => $input, 'output' => $output])->andReturn(m::mock(OutputStyle::class));

$application->shouldReceive('call')->with([$command, 'handle'])->andReturnUsing(function () use ($command, $application) {
Expand Down Expand Up @@ -84,7 +84,7 @@ protected function getOptions()
'--option-one' => 'test-first-option',
'--option-two' => 'test-second-option',
]);
$output = new NullOutput();
$output = new NullOutput;

$command->run($input, $output);

Expand Down
2 changes: 1 addition & 1 deletion tests/Container/ContainerTaggingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function testContainerTags()
public function testTaggedServicesAreLazyLoaded()
{
$container = $this->createPartialMock(Container::class, ['make']);
$container->expects($this->once())->method('make')->willReturn(new ContainerImplementationTaggedStub());
$container->expects($this->once())->method('make')->willReturn(new ContainerImplementationTaggedStub);

$container->tag(ContainerImplementationTaggedStub::class, ['foo']);
$container->tag(ContainerImplementationTaggedStubTwo::class, ['foo']);
Expand Down
2 changes: 1 addition & 1 deletion tests/Container/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function testBindFailsLoudlyWithInvalidArgument()
$this->expectException(TypeError::class);
$container = new Container;

$concrete = new ContainerConcreteStub();
$concrete = new ContainerConcreteStub;
$container->bind(ContainerConcreteStub::class, $concrete);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Container/ResolvingCallbackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public function testResolvingCallbacksAreCallWhenRebindHappenForResolvedAbstract
$this->assertEquals(3, $callCounter);

$container->bind(ResolvingContractStub::class, function () {
return new ResolvingImplementationStubTwo();
return new ResolvingImplementationStubTwo;
});
$this->assertEquals(4, $callCounter);

Expand Down
6 changes: 3 additions & 3 deletions tests/Cookie/Middleware/AddQueuedCookiesToResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ class AddQueuedCookiesToResponseTest extends TestCase
{
public function testHandle(): void
{
$cookieJar = new CookieJar();
$cookieJar = new CookieJar;
$cookieOne = $cookieJar->make('foo', 'bar', 0, '/path');
$cookieTwo = $cookieJar->make('foo', 'rab', 0, '/');
$cookieJar->queue($cookieOne);
$cookieJar->queue($cookieTwo);
$addQueueCookiesToResponseMiddleware = new AddQueuedCookiesToResponse($cookieJar);
$next = function (Request $request) {
return new Response();
return new Response;
};
$this->assertEquals(
[
Expand All @@ -33,7 +33,7 @@ public function testHandle(): void
],
],
],
$addQueueCookiesToResponseMiddleware->handle(new Request(), $next)->headers->getCookies(ResponseHeaderBag::COOKIES_ARRAY)
$addQueueCookiesToResponseMiddleware->handle(new Request, $next)->headers->getCookies(ResponseHeaderBag::COOKIES_ARRAY)
);
}
}
10 changes: 5 additions & 5 deletions tests/Database/DatabaseEloquentBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ public function testQueryPassThru()
$this->assertSame('foo', $builder->raw('bar'));

$builder = $this->getBuilder();
$grammar = new Grammar();
$grammar = new Grammar;
$builder->getQuery()->shouldReceive('getGrammar')->once()->andReturn($grammar);
$this->assertSame($grammar, $builder->getGrammar());
}
Expand Down Expand Up @@ -1097,7 +1097,7 @@ public function testWhereKeyMethodWithInt()

public function testWhereKeyMethodWithStringZero()
{
$model = new EloquentBuilderTestStubStringPrimaryKey();
$model = new EloquentBuilderTestStubStringPrimaryKey;
$builder = $this->getBuilder()->setModel($model);
$keyName = $model->getQualifiedKeyName();

Expand All @@ -1110,7 +1110,7 @@ public function testWhereKeyMethodWithStringZero()

public function testWhereKeyMethodWithStringNull()
{
$model = new EloquentBuilderTestStubStringPrimaryKey();
$model = new EloquentBuilderTestStubStringPrimaryKey;
$builder = $this->getBuilder()->setModel($model);
$keyName = $model->getQualifiedKeyName();

Expand Down Expand Up @@ -1149,7 +1149,7 @@ public function testWhereKeyMethodWithCollection()

public function testWhereKeyNotMethodWithStringZero()
{
$model = new EloquentBuilderTestStubStringPrimaryKey();
$model = new EloquentBuilderTestStubStringPrimaryKey;
$builder = $this->getBuilder()->setModel($model);
$keyName = $model->getQualifiedKeyName();

Expand All @@ -1162,7 +1162,7 @@ public function testWhereKeyNotMethodWithStringZero()

public function testWhereKeyNotMethodWithStringNull()
{
$model = new EloquentBuilderTestStubStringPrimaryKey();
$model = new EloquentBuilderTestStubStringPrimaryKey;
$builder = $this->getBuilder()->setModel($model);
$keyName = $model->getQualifiedKeyName();

Expand Down
16 changes: 8 additions & 8 deletions tests/Database/DatabaseEloquentCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ public function testCollectionDiffsWithGivenCollection()

public function testCollectionReturnsDuplicateBasedOnlyOnKeys()
{
$one = new TestEloquentCollectionModel();
$two = new TestEloquentCollectionModel();
$three = new TestEloquentCollectionModel();
$four = new TestEloquentCollectionModel();
$one = new TestEloquentCollectionModel;
$two = new TestEloquentCollectionModel;
$three = new TestEloquentCollectionModel;
$four = new TestEloquentCollectionModel;
$one->id = 1;
$one->someAttribute = '1';
$two->id = 1;
Expand Down Expand Up @@ -346,10 +346,10 @@ public function testCollectionReturnsUniqueItems()

public function testCollectionReturnsUniqueStrictBasedOnKeysOnly()
{
$one = new TestEloquentCollectionModel();
$two = new TestEloquentCollectionModel();
$three = new TestEloquentCollectionModel();
$four = new TestEloquentCollectionModel();
$one = new TestEloquentCollectionModel;
$two = new TestEloquentCollectionModel;
$three = new TestEloquentCollectionModel;
$four = new TestEloquentCollectionModel;
$one->id = 1;
$one->someAttribute = '1';
$two->id = 1;
Expand Down
2 changes: 1 addition & 1 deletion tests/Database/DatabaseEloquentIrregularPluralTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function schema()
/** @test */
public function itPluralizesTheTableName()
{
$model = new IrregularPluralHuman();
$model = new IrregularPluralHuman;

$this->assertSame('irregular_plural_humans', $model->getTable());
}
Expand Down
8 changes: 4 additions & 4 deletions tests/Database/DatabaseEloquentModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function testAttributeManipulation()

public function testSetAttributeWithNumericKey()
{
$model = new EloquentDateModelStub();
$model = new EloquentDateModelStub;
$model->setAttribute(0, 'value');

$this->assertEquals([0 => 'value'], $model->getAttributes());
Expand All @@ -95,7 +95,7 @@ public function testDirtyAttributes()

public function testIntAndNullComparisonWhenDirty()
{
$model = new EloquentModelCastingStub();
$model = new EloquentModelCastingStub;
$model->intAttribute = null;
$model->syncOriginal();
$this->assertFalse($model->isDirty('intAttribute'));
Expand All @@ -105,7 +105,7 @@ public function testIntAndNullComparisonWhenDirty()

public function testFloatAndNullComparisonWhenDirty()
{
$model = new EloquentModelCastingStub();
$model = new EloquentModelCastingStub;
$model->floatAttribute = null;
$model->syncOriginal();
$this->assertFalse($model->isDirty('floatAttribute'));
Expand Down Expand Up @@ -2110,7 +2110,7 @@ public function testNotTouchingModelWithoutTimestamps()

public function testGetOriginalCastsAttributes()
{
$model = new EloquentModelCastingStub();
$model = new EloquentModelCastingStub;
$model->intAttribute = '1';
$model->floatAttribute = '0.1234';
$model->stringAttribute = 432;
Expand Down
2 changes: 1 addition & 1 deletion tests/Database/DatabaseEloquentPivotTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function testPivotModelWithoutParentReturnsModelTimestampColumns()

public function testWithoutRelations()
{
$original = new Pivot();
$original = new Pivot;

$original->pivotParent = 'foo';
$original->setRelation('bar', 'baz');
Expand Down
4 changes: 2 additions & 2 deletions tests/Database/DatabaseMigrationRefreshCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function tearDown(): void

public function testRefreshCommandCallsCommandsWithProperArguments()
{
$command = new RefreshCommand();
$command = new RefreshCommand;

$app = new ApplicationDatabaseRefreshStub(['path.database' => __DIR__]);
$dispatcher = $app->instance(Dispatcher::class, $events = m::mock());
Expand All @@ -49,7 +49,7 @@ public function testRefreshCommandCallsCommandsWithProperArguments()

public function testRefreshCommandCallsCommandsWithStep()
{
$command = new RefreshCommand();
$command = new RefreshCommand;

$app = new ApplicationDatabaseRefreshStub(['path.database' => __DIR__]);
$dispatcher = $app->instance(Dispatcher::class, $events = m::mock());
Expand Down
4 changes: 2 additions & 2 deletions tests/Database/DatabaseMySqlBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected function tearDown(): void

public function testCreateDatabase()
{
$grammar = new MySqlGrammar();
$grammar = new MySqlGrammar;

$connection = m::mock(Connection::class);
$connection->shouldReceive('getConfig')->once()->with('charset')->andReturn('utf8mb4');
Expand All @@ -33,7 +33,7 @@ public function testCreateDatabase()

public function testDropDatabaseIfExists()
{
$grammar = new MySqlGrammar();
$grammar = new MySqlGrammar;

$connection = m::mock(Connection::class);
$connection->shouldReceive('getSchemaGrammar')->once()->andReturn($grammar);
Expand Down
4 changes: 2 additions & 2 deletions tests/Database/DatabasePostgresBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected function tearDown(): void

public function testCreateDatabase()
{
$grammar = new PostgresGrammar();
$grammar = new PostgresGrammar;

$connection = m::mock(Connection::class);
$connection->shouldReceive('getConfig')->once()->with('charset')->andReturn('utf8');
Expand All @@ -32,7 +32,7 @@ public function testCreateDatabase()

public function testDropDatabaseIfExists()
{
$grammar = new PostgresGrammar();
$grammar = new PostgresGrammar;

$connection = m::mock(Connection::class);
$connection->shouldReceive('getSchemaGrammar')->once()->andReturn($grammar);
Expand Down
Loading