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 | da7048f0673c0c5dc8b6ec65c104b9fbfc9d1ec3.json | install phpredis extension via pecl | .travis.yml | @@ -30,7 +30,7 @@ services:
before_install:
- if [[ $TRAVIS_PHP_VERSION != 7.1 ]] ; then phpenv config-rm xdebug.ini; fi
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- - echo "extension = redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
+ - pecl i... | false |
Other | laravel | framework | d6cb75c057009c6316d4efd865dccb3c4a5c7b36.json | fix faking of model events | src/Illuminate/Support/Facades/Event.php | @@ -2,6 +2,7 @@
namespace Illuminate\Support\Facades;
+use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Testing\Fakes\EventFake;
/**
@@ -16,7 +17,9 @@ class Event extends Facade
*/
public static function fake()
{
- static::swap(new EventFake);
+ static::swap($fake = ... | false |
Other | laravel | framework | 74cd4cd1f4458fcc1c6ad1f526025c2a5aab018b.json | fix broken shortcut | src/Illuminate/Foundation/Console/ListenerMakeCommand.php | @@ -113,7 +113,7 @@ protected function getOptions()
return [
['event', 'e', InputOption::VALUE_REQUIRED, 'The event class being listened for.'],
- ['queued', 'q', InputOption::VALUE_NONE, 'Indicates the event listener should be queued.'],
+ ['queued', null, InputOption::VAL... | false |
Other | laravel | framework | 4df653ef08ce2d6035acb21c4192bb2886e3f6e1.json | add check for simple equals | src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php | @@ -982,7 +982,9 @@ protected function originalIsEquivalent($key, $current)
return false;
}
- $original = $this->getOriginal($key);
+ if ($current === $original = $this->getOriginal($key)) {
+ return true;
+ }
if ($this->isDateAttribute($key)) {
... | false |
Other | laravel | framework | a0402824bf479dc5135b40a7f40095d4e2bbb265.json | add date and cast check for dirty | src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php | @@ -960,11 +960,8 @@ public function getDirty()
{
$dirty = [];
- foreach ($this->attributes as $key => $value) {
- if (! array_key_exists($key, $this->original)) {
- $dirty[$key] = $value;
- } elseif ($value !== $this->original[$key] &&
- ! ... | false |
Other | laravel | framework | 3aa2adc7574b0ff6f4f3b3a75de4b3f9c19a9737.json | fix various problems with belongs to many (#18380) | src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php | @@ -284,15 +284,15 @@ public function morphMany($related, $name, $type = null, $id = null, $localKey =
*
* @param string $related
* @param string $table
- * @param string $foreignKey
- * @param string $relatedKey
+ * @param string $foreignPivotKey
+ * @param string $related... | true |
Other | laravel | framework | 3aa2adc7574b0ff6f4f3b3a75de4b3f9c19a9737.json | fix various problems with belongs to many (#18380) | src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php | @@ -25,14 +25,14 @@ class BelongsToMany extends Relation
*
* @var string
*/
- protected $foreignKey;
+ protected $foreignPivotKey;
/**
* The associated key of the relation.
*
* @var string
*/
- protected $relatedKey;
+ protected $relatedPivotKey;
/**
... | true |
Other | laravel | framework | 3aa2adc7574b0ff6f4f3b3a75de4b3f9c19a9737.json | fix various problems with belongs to many (#18380) | src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php | @@ -29,7 +29,7 @@ public function toggle($ids, $touch = true)
// checking which of the given ID/records is in the list of current records
// and removing all of those rows from this "intermediate" joining table.
$detach = array_values(array_intersect(
- $this->newPivotQuery()->pluc... | true |
Other | laravel | framework | 3aa2adc7574b0ff6f4f3b3a75de4b3f9c19a9737.json | fix various problems with belongs to many (#18380) | src/Illuminate/Database/Eloquent/Relations/MorphToMany.php | @@ -38,22 +38,25 @@ class MorphToMany extends BelongsToMany
* @param \Illuminate\Database\Eloquent\Model $parent
* @param string $name
* @param string $table
- * @param string $foreignKey
- * @param string $relatedKey
+ * @param string $foreignPivotKey
+ * @param string $... | true |
Other | laravel | framework | 3aa2adc7574b0ff6f4f3b3a75de4b3f9c19a9737.json | fix various problems with belongs to many (#18380) | tests/Database/DatabaseEloquentModelTest.php | @@ -1015,17 +1015,17 @@ public function testBelongsToManyCreatesProperRelation()
$this->addMockConnection($model);
$relation = $model->belongsToMany('Illuminate\Tests\Database\EloquentModelSaveStub');
- $this->assertEquals('eloquent_model_save_stub_eloquent_model_stub.eloquent_model_stub_id',... | true |
Other | laravel | framework | 420609a83efd0eb59b7c3643d30e7242333837cb.json | add ability to pretty print response
it is very difficult to view the failure response, since everything is
printed inline. this allows the options to ‘pretty print’ the JSON
output, just like is done in the ‘additional info’. | src/Illuminate/Foundation/Testing/Constraints/HasInDatabase.php | @@ -63,7 +63,7 @@ public function failureDescription($table)
{
return sprintf(
"a row in the table [%s] matches the attributes %s.\n\n%s",
- $table, $this->toString(), $this->getAdditionalInfo($table)
+ $table, $this->toString(JSON_PRETTY_PRINT), $this->getAdditionalInfo... | false |
Other | laravel | framework | 7b84baa5093e18fe988724bd27e1a58f191e000a.json | add assertion for soft deleted models
- add new method assertion to the `InteractsWithDatabase` trait
- create new constraint for soft deletes that checks that `deleted_at`
is not null
- a couple of tests for the new assertion | src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php | @@ -2,6 +2,7 @@
namespace Illuminate\Foundation\Testing\Concerns;
+use Illuminate\Foundation\Testing\Constraints\HasSoftDeletedInDatabase;
use PHPUnit_Framework_Constraint_Not as ReverseConstraint;
use Illuminate\Foundation\Testing\Constraints\HasInDatabase;
@@ -43,6 +44,23 @@ protected function assertDatabase... | true |
Other | laravel | framework | 7b84baa5093e18fe988724bd27e1a58f191e000a.json | add assertion for soft deleted models
- add new method assertion to the `InteractsWithDatabase` trait
- create new constraint for soft deletes that checks that `deleted_at`
is not null
- a couple of tests for the new assertion | src/Illuminate/Foundation/Testing/Constraints/HasSoftDeletedInDatabase.php | @@ -0,0 +1,102 @@
+<?php
+
+namespace Illuminate\Foundation\Testing\Constraints;
+
+use PHPUnit_Framework_Constraint;
+use Illuminate\Database\Connection;
+
+class HasSoftDeletedInDatabase extends PHPUnit_Framework_Constraint
+{
+ /**
+ * Number of records that will be shown in the console in case of failure.
+ ... | true |
Other | laravel | framework | 7b84baa5093e18fe988724bd27e1a58f191e000a.json | add assertion for soft deleted models
- add new method assertion to the `InteractsWithDatabase` trait
- create new constraint for soft deletes that checks that `deleted_at`
is not null
- a couple of tests for the new assertion | tests/Foundation/FoundationInteractsWithDatabaseTest.php | @@ -101,17 +101,39 @@ public function testDontSeeInDatabaseFindsResults()
$this->assertDatabaseMissing($this->table, $this->data);
}
+ public function testSeeSoftDeletedInDatabaseFindsResults()
+ {
+ $this->mockCountBuilder(1);
+
+ $this->assertDatabaseHasSoftDelete($this->table, $th... | true |
Other | laravel | framework | 4df49b483b3d7747f5bedcf396457ebe1dbf40b5.json | Apply fixes from StyleCI (#18323) | tests/Mail/MailMailableDataTest.php | @@ -12,13 +12,13 @@ public function testMailableDataIsNotLost()
$testData = ['first_name' => 'James'];
$mailable = new MailableStub;
- $mailable->build(function($m) use ($testData) {
+ $mailable->build(function ($m) use ($testData) {
$m->view('view', $testData);
}... | false |
Other | laravel | framework | c79a84e5ece3007ae24ec9617198bc67bbed575e.json | Reset Response content-type. (#18314) | src/Illuminate/Http/Response.php | @@ -23,6 +23,10 @@ public function setContent($content)
{
$this->original = $content;
+ if ($this->headers->get('Content-Type') === 'application/json') {
+ $this->headers->remove('Content-Type');
+ }
+
// If the content is "JSONable" we will set the appropriate header a... | true |
Other | laravel | framework | c79a84e5ece3007ae24ec9617198bc67bbed575e.json | Reset Response content-type. (#18314) | tests/Http/HttpResponseTest.php | @@ -41,6 +41,17 @@ public function testJsonResponsesAreConvertedAndHeadersAreSet()
$this->assertEquals('application/json', $response->headers->get('Content-Type'));
}
+ public function testResponseHeaderTypeIsReset()
+ {
+ $response = new \Illuminate\Http\Response(new ArrayableStub);
+ ... | true |
Other | laravel | framework | 563af376828934fb796e400c9f69a0ef439d53c9.json | Avoid aliases. (#18312) | src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php | @@ -189,7 +189,7 @@ public function withCount($relations)
// Finally we will add the proper result column alias to the query and run the subselect
// statement against the query builder. Then we will return the builder instance back
// to the developer for further constraint chain... | false |
Other | laravel | framework | d3befb99db7b6a2abd2ca6198fada8e1b786bb00.json | remove unused import | src/Illuminate/Console/Scheduling/Schedule.php | @@ -5,7 +5,6 @@
use Illuminate\Console\Application;
use Illuminate\Container\Container;
use Symfony\Component\Process\ProcessUtils;
-use Illuminate\Contracts\Cache\Repository as Cache;
class Schedule
{ | false |
Other | laravel | framework | 41df68e606e946d096bf851068d2b988a1a18717.json | apply StyleCI fixes | src/Illuminate/Console/Scheduling/CallbackEvent.php | @@ -5,7 +5,6 @@
use LogicException;
use InvalidArgumentException;
use Illuminate\Contracts\Container\Container;
-use Illuminate\Contracts\Cache\Repository as Cache;
class CallbackEvent extends Event
{ | true |
Other | laravel | framework | 41df68e606e946d096bf851068d2b988a1a18717.json | apply StyleCI fixes | src/Illuminate/Console/Scheduling/OverlappingStrategy.php | @@ -5,23 +5,23 @@
interface OverlappingStrategy
{
/**
- * prevents overlapping for the given event
+ * prevents overlapping for the given event.
*
* @param Event $event
* @return void
*/
public function prevent(Event $event);
/**
- * checks if the given event's co... | true |
Other | laravel | framework | 41df68e606e946d096bf851068d2b988a1a18717.json | apply StyleCI fixes | src/Illuminate/Console/Scheduling/Schedule.php | @@ -32,7 +32,7 @@ public function __construct()
{
$container = Container::getInstance();
- if (!$container->bound(OverlappingStrategy::class)) {
+ if (! $container->bound(OverlappingStrategy::class)) {
$this->overlappingStrategy = $container->make(CacheOverlappingStrategy::cla... | true |
Other | laravel | framework | 41df68e606e946d096bf851068d2b988a1a18717.json | apply StyleCI fixes | tests/Console/ConsoleEventSchedulerTest.php | @@ -2,7 +2,6 @@
namespace Illuminate\Tests\Console;
-use Illuminate\Container\Container;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use Illuminate\Console\Scheduling\Schedule; | true |
Other | laravel | framework | 41df68e606e946d096bf851068d2b988a1a18717.json | apply StyleCI fixes | tests/Console/Scheduling/CacheOverlappingStrategyTest.php | @@ -2,10 +2,10 @@
namespace Illuminate\Tests\Console\Scheduling;
-use Illuminate\Console\Scheduling\CacheOverlappingStrategy;
-use Illuminate\Console\Scheduling\Event;
-use PHPUnit\Framework\TestCase;
use Mockery as m;
+use PHPUnit\Framework\TestCase;
+use Illuminate\Console\Scheduling\Event;
+use Illuminate\Cons... | true |
Other | laravel | framework | 781d4c03b2cf56ee6b90d68e8a5766496b91799c.json | add tests for CacheOverlappingStrategy | tests/Console/Scheduling/CacheOverlappingStrategyTest.php | @@ -0,0 +1,73 @@
+<?php
+
+namespace Illuminate\Tests\Console\Scheduling;
+
+use Illuminate\Console\Scheduling\CacheOverlappingStrategy;
+use Illuminate\Console\Scheduling\Event;
+use PHPUnit\Framework\TestCase;
+use Mockery as m;
+
+class CacheOverlappingStrategyTest extends TestCase
+{
+ /**
+ * @var CacheOver... | false |
Other | laravel | framework | 42d5c856067368fe3fda0a43477a964866b073c5.json | fix broken schedule tests | tests/Console/ConsoleEventSchedulerTest.php | @@ -2,6 +2,7 @@
namespace Illuminate\Tests\Console;
+use Illuminate\Container\Container;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use Illuminate\Console\Scheduling\Schedule;
@@ -12,8 +13,12 @@ public function setUp()
{
parent::setUp();
- \Illuminate\Container\Container::getInstan... | true |
Other | laravel | framework | 42d5c856067368fe3fda0a43477a964866b073c5.json | fix broken schedule tests | tests/Console/ConsoleScheduledEventTest.php | @@ -35,7 +35,7 @@ public function testBasicCronCompilation()
$app->shouldReceive('isDownForMaintenance')->andReturn(false);
$app->shouldReceive('environment')->andReturn('production');
- $event = new Event(m::mock('Illuminate\Contracts\Cache\Repository'), 'php foo');
+ $event = new Eve... | true |
Other | laravel | framework | 42d5c856067368fe3fda0a43477a964866b073c5.json | fix broken schedule tests | tests/Console/Scheduling/EventTest.php | @@ -17,14 +17,14 @@ public function testBuildCommand()
{
$quote = (DIRECTORY_SEPARATOR == '\\') ? '"' : "'";
- $event = new Event(m::mock('Illuminate\Contracts\Cache\Repository'), 'php -i');
+ $event = new Event(m::mock('Illuminate\Console\Scheduling\OverlappingStrategy'), 'php -i');
... | true |
Other | laravel | framework | 42d5c856067368fe3fda0a43477a964866b073c5.json | fix broken schedule tests | tests/Console/Scheduling/FrequencyTest.php | @@ -16,7 +16,7 @@ class FrequencyTest extends TestCase
public function setUp()
{
$this->event = new Event(
- m::mock('Illuminate\Contracts\Cache\Repository'),
+ m::mock('Illuminate\Console\Scheduling\OverlappingStrategy'),
'php foo'
);
} | true |
Other | laravel | framework | 4a9e58918332bd33c71c931a3305f8a3a978b294.json | Return the insertId of released jobs (#18288) | src/Illuminate/Queue/Jobs/DatabaseJob.php | @@ -45,15 +45,15 @@ public function __construct(Container $container, DatabaseQueue $database, $job,
* Release the job back into the queue.
*
* @param int $delay
- * @return void
+ * @return mixed
*/
public function release($delay = 0)
{
parent::release($delay);
... | false |
Other | laravel | framework | c3cb531df1717c92bd1d70d30f2c018e56fd6b57.json | Apply fixes from StyleCI (#18287) | src/Illuminate/Notifications/NotificationSender.php | @@ -82,7 +82,7 @@ public function sendNow($notifiables, $notification, array $channels = null)
if (empty($viaChannels = $channels ?: $notification->via($notifiable))) {
continue;
}
-
+
$notificationId = Uuid::uuid4()->toString();
foreach... | false |
Other | laravel | framework | 9aa8da045fe3fd976f6766675e2f64aed82d16dd.json | Apply fixes from StyleCI (#18283) | src/Illuminate/Foundation/Console/VendorPublishCommand.php | @@ -90,7 +90,7 @@ protected function determineWhatShouldBePublished()
}
[$this->provider, $this->tags] = [
- $this->option('provider'), (array) $this->option('tag')
+ $this->option('provider'), (array) $this->option('tag'),
];
if (! $this->provider && ! $thi... | false |
Other | laravel | framework | a03088928d1d6b3680c10727d169817324e45967.json | Apply fixes from StyleCI (#18281) | tests/Validation/ValidationValidatorTest.php | @@ -1976,10 +1976,10 @@ public function testValidateMimetypes()
$file = $this->getMockBuilder('Symfony\Component\HttpFoundation\File\UploadedFile')->setMethods(['guessExtension'])->setConstructorArgs($uploadedFile)->getMock();
$file->expects($this->any())->method('guessExtension')->will($this->retur... | false |
Other | laravel | framework | fe1ef6570d10c955da8e90c8be429d96ad5574ee.json | allow wildcard mime types | src/Illuminate/Validation/Concerns/ValidatesAttributes.php | @@ -926,7 +926,9 @@ protected function validateMimetypes($attribute, $value, $parameters)
return false;
}
- return $value->getPath() != '' && (in_array($value->getMimeType(), $parameters) || in_array(explode('/', $value->getMimeType())[0] . '/*', $parameters));
+ return $value->get... | false |
Other | laravel | framework | 394f0fecfa84764f66c49c3b025dd7eb26aa61cd.json | Replace custom implementation | src/Illuminate/Console/ConfirmableTrait.php | @@ -26,9 +26,7 @@ public function confirmToProceed($warning = 'Application In Production!', $callb
return true;
}
- $this->comment(str_repeat('*', strlen($warning) + 12));
- $this->comment('* '.$warning.' *');
- $this->comment(str_repeat('*', strl... | false |
Other | laravel | framework | ec938862f165f1c2b69c1dea55d1ec2b419bde6e.json | Add alert method | src/Illuminate/Console/Command.php | @@ -433,6 +433,19 @@ public function comment($string, $verbosity = null)
$this->line($string, 'comment', $verbosity);
}
+ /**
+ * Write a string in an alert box.
+ *
+ * @param string $string
+ * @return void
+ */
+ public function alert($string)
+ {
+ $this->commen... | false |
Other | laravel | framework | 5c85962b75f5737f674c3e39b234e1f8c614353c.json | Update HttpJsonResponseTest.php (#18261) | tests/Http/HttpJsonResponseTest.php | @@ -9,23 +9,23 @@
class HttpJsonResponseTest extends TestCase
{
- public function testSeAndRetrieveJsonableData()
+ public function testSetAndRetrieveJsonableData()
{
$response = new \Illuminate\Http\JsonResponse(new JsonResponseTestJsonableObject);
$data = $response->getData();
... | false |
Other | laravel | framework | 117fe4501d93119022f2e653e55dd961dddb22ff.json | Show publishable tags in addition to providers | src/Illuminate/Foundation/Console/VendorPublishCommand.php | @@ -18,6 +18,20 @@ class VendorPublishCommand extends Command
*/
protected $files;
+ /**
+ * The provider to publish.
+ *
+ * @var string
+ */
+ protected $provider = null;
+
+ /**
+ * The tags to publish.
+ *
+ * @var array
+ */
+ protected $tags = [];
+
/*... | true |
Other | laravel | framework | 117fe4501d93119022f2e653e55dd961dddb22ff.json | Show publishable tags in addition to providers | src/Illuminate/Support/ServiceProvider.php | @@ -169,11 +169,21 @@ protected function addPublishGroup($group, $paths)
*
* @return array
*/
- public static function providersAvailableToPublish()
+ public static function publishableProviders()
{
return array_keys(static::$publishes);
}
+ /**
+ * Get the groups ava... | true |
Other | laravel | framework | 117fe4501d93119022f2e653e55dd961dddb22ff.json | Show publishable tags in addition to providers | tests/Support/SupportServiceProviderTest.php | @@ -22,14 +22,20 @@ public function tearDown()
m::close();
}
- public function testGetAvailableServiceProvidersToPublish()
+ public function testPublishableServiceProviders()
{
- $availableToPublish = ServiceProvider::providersAvailableToPublish();
+ $toPublish = ServiceProvider... | true |
Other | laravel | framework | b4f000516166b0694e842d64f5b2fde1167d4690.json | change exception type | src/Illuminate/Foundation/ProviderRepository.php | @@ -2,8 +2,8 @@
namespace Illuminate\Foundation;
+use Exception;
use Illuminate\Filesystem\Filesystem;
-use Illuminate\Contracts\Filesystem\FileNotFoundException;
use Illuminate\Contracts\Foundation\Application as ApplicationContract;
class ProviderRepository
@@ -181,12 +181,12 @@ protected function freshMani... | false |
Other | laravel | framework | 52016015ad9d51278bbe91310b9cf5315d2a7289.json | allow scheduling of queued jobs | src/Illuminate/Console/Scheduling/Schedule.php | @@ -4,6 +4,7 @@
use Illuminate\Console\Application;
use Illuminate\Container\Container;
+use Illuminate\Contracts\Queue\ShouldQueue;
use Symfony\Component\Process\ProcessUtils;
use Illuminate\Contracts\Cache\Repository as Cache;
@@ -48,6 +49,19 @@ public function call($callback, array $parameters = [])
... | false |
Other | laravel | framework | a74c4439a0762722b3173ac5ed58eecb43f49aad.json | Prefix an option `0` that publishes all | src/Illuminate/Foundation/Console/VendorPublishCommand.php | @@ -92,10 +92,15 @@ protected function providerToPublish()
return $this->option('provider');
}
- return $this->choice(
+ $choice = $this->choice(
"Which package's files would you like to publish?",
- ServiceProvider::providersAvailableToPublish()
+ ... | false |
Other | laravel | framework | 8784966b45f018d6880c809fa488b4a68d01d33b.json | Add any() method to ViewErrorBag | src/Illuminate/Support/ViewErrorBag.php | @@ -70,6 +70,16 @@ public function count()
return $this->getBag('default')->count();
}
+ /**
+ * Determine if the default message bag has any messages.
+ *
+ * @return bool
+ */
+ public function any()
+ {
+ return $this->count() > 0;
+ }
+
/**
* Dynamically... | false |
Other | laravel | framework | bd7c0a94db7888a21d2c05f73d57e32d582044a9.json | Apply fixes from StyleCI (#18174) | src/Illuminate/Http/ResponseTrait.php | @@ -6,7 +6,6 @@
use Symfony\Component\HttpFoundation\HeaderBag;
use Illuminate\Http\Exceptions\HttpResponseException;
-
trait ResponseTrait
{
/** | false |
Other | laravel | framework | d2b6c8bc5cc443e41bcfe344973e105b728bebb5.json | Fix MySQL deletes with JOIN and ALias | src/Illuminate/Database/Query/Grammars/MySqlGrammar.php | @@ -242,7 +242,13 @@ protected function compileDeleteWithJoins($query, $table, $where)
{
$joins = ' '.$this->compileJoins($query, $query->joins);
- return trim("delete {$table} from {$table}{$joins} {$where}");
+ $alias = $table;
+
+ if (strpos(strtolower($table), ' as ') !== false)... | true |
Other | laravel | framework | d2b6c8bc5cc443e41bcfe344973e105b728bebb5.json | Fix MySQL deletes with JOIN and ALias | tests/Database/DatabaseQueryBuilderTest.php | @@ -1433,6 +1433,11 @@ public function testDeleteWithJoinMethod()
$result = $builder->from('users')->join('contacts', 'users.id', '=', 'contacts.id')->where('email', '=', 'foo')->orderBy('id')->limit(1)->delete();
$this->assertEquals(1, $result);
+ $builder = $this->getMySqlBuilder();
+ ... | true |
Other | laravel | framework | 4d4040b601b9e5eb469af8c221c372abd8e9948a.json | Add whereNotIn() to Collection (#18157) | src/Illuminate/Support/Collection.php | @@ -416,6 +416,35 @@ public function whereInStrict($key, $values)
return $this->whereIn($key, $values, true);
}
+ /**
+ * Filter items by the given key value pair.
+ *
+ * @param string $key
+ * @param mixed $values
+ * @param bool $strict
+ * @return static
+ */
+ ... | true |
Other | laravel | framework | 4d4040b601b9e5eb469af8c221c372abd8e9948a.json | Add whereNotIn() to Collection (#18157) | tests/Support/SupportCollectionTest.php | @@ -397,6 +397,18 @@ public function testWhereInStrict()
$this->assertEquals([['v' => 1], ['v' => 3]], $c->whereInStrict('v', [1, 3])->values()->all());
}
+ public function testWhereNotIn()
+ {
+ $c = new Collection([['v' => 1], ['v' => 2], ['v' => 3], ['v' => '3'], ['v' => 4]]);
+ $... | true |
Other | laravel | framework | 886f7ab114794140128ae47db1c16bb03482e690.json | Fix Spelling mistake (#18164) | src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php | @@ -145,7 +145,7 @@ public function isFillable($key)
}
// If the attribute is explicitly listed in the "guarded" array then we can
- // retunr false immediately. This means this attribute is definitely not
+ // return false immediately. This means this attribute is definitely not
... | false |
Other | laravel | framework | 05e4e9e43857adacffd87f4066a10b2ceccae774.json | Convert rule object to string once | src/Illuminate/Validation/ValidationRuleParser.php | @@ -82,9 +82,9 @@ protected function explodeExplicitRule($rule)
if (is_string($rule)) {
return explode('|', $rule);
} elseif (is_object($rule)) {
- return [$rule];
+ return [strval($rule)];
} else {
- return $rule;
+ return array_map('s... | false |
Other | laravel | framework | c5a62901589e313474376e241549ac31d9d3c695.json | fix bug with has events | src/Illuminate/Database/Eloquent/Concerns/HasEvents.php | @@ -138,7 +138,11 @@ protected function fireModelEvent($event, $halt = true)
$result = $this->fireCustomModelEvent($event, $method);
- return ! is_null($result) ? $result : static::$dispatcher->{$method}(
+ if ($result === false) {
+ return false;
+ }
+
+ return ! emp... | false |
Other | laravel | framework | 063e5ae341c32220d4679d0215ab9b263d0c8a33.json | make fix in other location | src/Illuminate/Database/Eloquent/Relations/MorphToMany.php | @@ -130,7 +130,7 @@ public function newPivot(array $attributes = [], $exists = false)
{
$using = $this->using;
- $pivot = $using ? new $using($this->parent, $attributes, $this->table, $exists)
+ $pivot = $using ? $using::fromRawAttributes($this->parent, $attributes, $this->table, $exists)
... | false |
Other | laravel | framework | 8be9acfbb802a74b4939eb84c24c4f151c30512a.json | Add getActionMethod to Route.php (#18105)
* Update Route.php
* Update Route.php
* Update Route.php | src/Illuminate/Routing/Route.php | @@ -647,6 +647,16 @@ public function getActionName()
return isset($this->action['controller']) ? $this->action['controller'] : 'Closure';
}
+ /**
+ * Get the method name of the route action.
+ *
+ * @return string
+ */
+ public function getActionMethod()
+ {
+ return arra... | false |
Other | laravel | framework | 862c80de2c84c360b35ee814a0ce101e89dcb038.json | Highlight breaking changes | CHANGELOG-5.5.md | @@ -3,35 +3,38 @@
## [Unreleased]
### General
-- Require PHP 7+ ([06907a0](https://github.com/laravel/framework/pull/17048/commits/06907a055e3d28c219f6b6ab97902f0be3e8a4ef), [39809ce](https://github.com/laravel/framework/pull/17048/commits/39809cea81a5564d196c16a87cbc25de88dd3d1c))
-- Removed deprecated `ServicePro... | false |
Other | laravel | framework | e4c0de68cab03c5e683ac42e405b91eeee733d57.json | Ensure Illumitate\Contracts is required. (#18087) | src/Illuminate/Translation/composer.json | @@ -15,6 +15,7 @@
],
"require": {
"php": ">=5.6.4",
+ "illuminate/contracts": "5.4.*",
"illuminate/filesystem": "5.4.*",
"illuminate/support": "5.4.*"
}, | false |
Other | laravel | framework | 2a728804ccc1ef63fcf4fae3b4d5d73eda04dbba.json | remove strange test | tests/Routing/RoutingRouteTest.php | @@ -309,24 +309,6 @@ public function testClassesCanBeInjectedIntoRoutes()
unset($_SERVER['__test.route_inject']);
}
- public function testClassesAndVariablesCanBeInjectedIntoRoutes()
- {
- unset($_SERVER['__test.route_inject']);
- $router = $this->getRouter();
- $router->get('... | false |
Other | laravel | framework | e4d46c030628cbf06c48a5fb742a7fd1d8dc302b.json | add more tests | tests/View/Blade/BladeIncludeWhenTest.php | @@ -18,6 +18,8 @@ public function testIncludeWhensAreCompiled()
$compiler = new BladeCompiler($this->getFiles(), __DIR__);
$this->assertEquals('<?php if (true) echo $__env->make(\'foo\', array_except(get_defined_vars(), array(\'__data\', \'__path\')))->render(); ?>', $compiler->compileString('@include... | false |
Other | laravel | framework | 5fe39aa3bac01f49ffaf5d44bf03688690106dbe.json | Add includeWhen directive | src/Illuminate/View/Compilers/Concerns/CompilesIncludes.php | @@ -40,4 +40,23 @@ protected function compileIncludeIf($expression)
return "<?php if (\$__env->exists({$expression})) echo \$__env->make({$expression}, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>";
}
+
+ /**
+ * Compile the include-when statements into valid PHP.
+ ... | true |
Other | laravel | framework | 5fe39aa3bac01f49ffaf5d44bf03688690106dbe.json | Add includeWhen directive | tests/View/Blade/BladeIncludeWhenTest.php | @@ -0,0 +1,27 @@
+<?php
+
+namespace Illuminate\Tests\Blade;
+
+use Mockery as m;
+use PHPUnit\Framework\TestCase;
+use Illuminate\View\Compilers\BladeCompiler;
+
+class BladeIncludeWhenTest extends TestCase
+{
+ public function tearDown()
+ {
+ m::close();
+ }
+
+ public function testIncludeWhensAre... | true |
Other | laravel | framework | 2f4135d8db5ded851d1f4f611124c53b768a3c08.json | Update HasRelations::morphInstanceTo() (#18058)
I changed this line so that the static method getActualClassNameForMorph can be overridden.
In my case, the morph relationship is idetified by integers, so I rewrote the static method getActualClassNameForMorph. | src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php | @@ -176,7 +176,7 @@ protected function morphEagerTo($name, $type, $id)
protected function morphInstanceTo($target, $name, $type, $id)
{
$instance = $this->newRelatedInstance(
- Model::getActualClassNameForMorph($target)
+ static::getActualClassNameForMorph($target)
);
... | false |
Other | laravel | framework | 4994f37c782672bd9d32b6d4277f9613e14d8429.json | Apply fixes from StyleCI (#18039) | src/Illuminate/Contracts/Queue/Job.php | @@ -68,7 +68,7 @@ public function maxTries();
* @return int|null
*/
public function timeout();
-
+
/**
* Get the name of the queued job class.
* | false |
Other | laravel | framework | 8eecd3fba0dcedd9e5abcded780a6eab0a86344a.json | improve the expression (#18017) | src/Illuminate/Queue/Worker.php | @@ -264,7 +264,7 @@ protected function runJob($job, $connectionName, WorkerOptions $options)
}
/**
- * Process a given job from the queue.
+ * Process the given job from the queue.
*
* @param string $connectionName
* @param \Illuminate\Contracts\Queue\Job $job | false |
Other | laravel | framework | 544faace7a605ab2dbf91365f4d46502194357f8.json | Fix route bidnings | src/Illuminate/Routing/RouteDependencyResolverTrait.php | @@ -31,21 +31,30 @@ protected function resolveClassMethodDependencies(array $parameters, $instance,
/**
* Resolve the given method's type-hinted dependencies.
*
- * @param array $parameters
+ * @param array $originalParameters
* @param \ReflectionFunctionAbstract $reflector
* ... | true |
Other | laravel | framework | 544faace7a605ab2dbf91365f4d46502194357f8.json | Fix route bidnings | tests/Routing/RoutingRouteTest.php | @@ -309,6 +309,24 @@ public function testClassesCanBeInjectedIntoRoutes()
unset($_SERVER['__test.route_inject']);
}
+ public function testClassesAndVariablesCanBeInjectedIntoRoutes()
+ {
+ unset($_SERVER['__test.route_inject']);
+ $router = $this->getRouter();
+ $router->get('... | true |
Other | laravel | framework | a8e8b75ea7bc77919968300410b9739e7e6076f8.json | Add replaceDimensions for validator messages
* Added tests for that | src/Illuminate/Validation/Concerns/ReplacesAttributes.php | @@ -355,4 +355,25 @@ protected function replaceAfterOrEqual($message, $attribute, $rule, $parameters)
{
return $this->replaceBefore($message, $attribute, $rule, $parameters);
}
+
+ /**
+ * Replace all place-holders for the dimensions rule.
+ *
+ * @param string $message
+ * @para... | true |
Other | laravel | framework | a8e8b75ea7bc77919968300410b9739e7e6076f8.json | Add replaceDimensions for validator messages
* Added tests for that | tests/Validation/ValidationValidatorTest.php | @@ -215,6 +215,26 @@ public function testClassBasedCustomReplacers()
$this->assertEquals('replaced!', $v->messages()->first('name'));
}
+ public function testNestedAttributesAreReplacedInDimensions()
+ {
+ // Knowing that demo image.gif has width = 3 and height = 2
+ $uploadedFile = ... | true |
Other | laravel | framework | dbaf3b10f1daa483a1db840c60ec95337c9a1f6e.json | add asssertion for session errors | src/Illuminate/Foundation/Testing/TestResponse.php | @@ -428,6 +428,32 @@ public function assertSessionHasAll(array $bindings)
return $this;
}
+ /**
+ * Assert that the session has the given errors.
+ *
+ * @param string|array $keys
+ * @param mixed $format
+ * @return $this
+ */
+ public function assertSessionHasErrors($... | false |
Other | laravel | framework | 29a181fd64a1d07e071351e61e8403bf00ea4b3c.json | Change property name in Pivot class (#17933)
Make it possible to use ‘parent’ as a relation | src/Illuminate/Database/Eloquent/Relations/Pivot.php | @@ -12,7 +12,7 @@ class Pivot extends Model
*
* @var \Illuminate\Database\Eloquent\Model
*/
- protected $parent;
+ protected $pivotParent;
/**
* The name of the foreign key column.
@@ -59,7 +59,7 @@ public function __construct(Model $parent, $attributes, $table, $exists = false)
... | false |
Other | laravel | framework | 64cf746c54417707854106df52a4f41d4ed437de.json | Fix typo in comments | src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php | @@ -592,7 +592,7 @@ protected function hydratePivotRelation(array $models)
{
// To hydrate the pivot relationship, we will just gather the pivot attributes
// and create a new Pivot model, which is basically a dynamic model that we
- // will set the attributes, table, and connections on so... | false |
Other | laravel | framework | 3cf02fa30ff6087ad14111c6d73e917dcb2920a6.json | Add a when method to Collection (#17917) | src/Illuminate/Support/Collection.php | @@ -308,6 +308,22 @@ public function filter(callable $callback = null)
return new static(array_filter($this->items));
}
+ /**
+ * Apply the callback if the value is truthy.
+ *
+ * @param bool $value
+ * @param callable $callback
+ * @return mixed
+ */
+ public function... | true |
Other | laravel | framework | 3cf02fa30ff6087ad14111c6d73e917dcb2920a6.json | Add a when method to Collection (#17917) | tests/Support/SupportCollectionTest.php | @@ -1895,6 +1895,25 @@ public function testTap()
$this->assertSame([1], $fromTap);
$this->assertSame([1, 2, 3], $collection->toArray());
}
+
+ public function testWhen()
+ {
+ $collection = new Collection(['michael', 'tom']);
+
+ $collection->when(true, function ($collection) ... | true |
Other | laravel | framework | 20950646e0b8108599c1f87607d030af4152992e.json | Fix zRangeByScore syntax for PhpRedis (#17912) | src/Illuminate/Redis/Connections/PhpRedisConnection.php | @@ -200,10 +200,18 @@ public function disconnect()
*/
public function __call($method, $parameters)
{
+ $method = strtolower($method);
+
if ($method == 'eval') {
return $this->proxyToEval($parameters);
}
+ if ($method == 'zrangebyscore' || $method == 'zrevra... | false |
Other | laravel | framework | c0f425cd5838d9b00c10c51137e99a88b5f28c93.json | add $localKey to MorphToMany relation | src/Illuminate/Database/Eloquent/Relations/MorphToMany.php | @@ -40,19 +40,19 @@ class MorphToMany extends BelongsToMany
* @param string $table
* @param string $foreignKey
* @param string $relatedKey
- * @param string $localKey
* @param string $parentKey
+ * @param string $localKey
* @param string $relationName
* @param ... | false |
Other | laravel | framework | 36e89bd842173b1e7aaa49a351626d6df4fe62ae.json | fix some docs | src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php | @@ -112,8 +112,8 @@ class BelongsToMany extends Relation
* @param string $table
* @param string $foreignKey
* @param string $relatedKey
- * @param string $localKey
* @param string $parentKey
+ * @param string $localKey
* @param string $relationName
* @return voi... | true |
Other | laravel | framework | 36e89bd842173b1e7aaa49a351626d6df4fe62ae.json | fix some docs | src/Illuminate/Database/Eloquent/Relations/MorphToMany.php | @@ -41,6 +41,7 @@ class MorphToMany extends BelongsToMany
* @param string $foreignKey
* @param string $relatedKey
* @param string $localKey
+ * @param string $parentKey
* @param string $relationName
* @param bool $inverse
* @return void | true |
Other | laravel | framework | 0eb18d4bf2dd65ad08a471d5ecf4fc8d1f6324c3.json | add protected property | src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php | @@ -34,6 +34,13 @@ class BelongsToMany extends Relation
*/
protected $relatedKey;
+ /**
+ * The local key of the parent model.
+ *
+ * @var string
+ */
+ protected $localKey;
+
/**
* The "name" of the relationship.
* | false |
Other | laravel | framework | 7c7c3bc4be3052afe0889fe323230dfd92f81000.json | fix missing things | src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php | @@ -286,6 +286,7 @@ public function morphMany($related, $name, $type = null, $id = null, $localKey =
* @param string $table
* @param string $foreignKey
* @param string $relatedKey
+ * @param string $localKey
* @param string $relation
* @return \Illuminate\Database\Eloquent\Re... | true |
Other | laravel | framework | 7c7c3bc4be3052afe0889fe323230dfd92f81000.json | fix missing things | src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php | @@ -98,16 +98,17 @@ class BelongsToMany extends Relation
* @param string $table
* @param string $foreignKey
* @param string $relatedKey
+ * @param string $localKey
* @param string $relationName
* @return void
*/
public function __construct(Builder $query, Model $pa... | true |
Other | laravel | framework | 7c7c3bc4be3052afe0889fe323230dfd92f81000.json | fix missing things | src/Illuminate/Database/Eloquent/Relations/MorphToMany.php | @@ -40,6 +40,7 @@ class MorphToMany extends BelongsToMany
* @param string $table
* @param string $foreignKey
* @param string $relatedKey
+ * @param string $localKey
* @param string $relationName
* @param bool $inverse
* @return void | true |
Other | laravel | framework | b900c41ecc2baafefaad3b545b51807334c52c15.json | fix MorphToMany test | src/Illuminate/Database/Eloquent/Relations/MorphToMany.php | @@ -44,13 +44,13 @@ class MorphToMany extends BelongsToMany
* @param bool $inverse
* @return void
*/
- public function __construct(Builder $query, Model $parent, $name, $table, $foreignKey, $relatedKey, $relationName = null, $inverse = false)
+ public function __construct(Builder $query, Model... | true |
Other | laravel | framework | b900c41ecc2baafefaad3b545b51807334c52c15.json | fix MorphToMany test | tests/Database/DatabaseEloquentMorphToManyTest.php | @@ -74,7 +74,7 @@ public function getRelation()
{
list($builder, $parent) = $this->getRelationArguments();
- return new MorphToMany($builder, $parent, 'taggable', 'taggables', 'taggable_id', 'tag_id');
+ return new MorphToMany($builder, $parent, 'taggable', 'taggables', 'taggable_id', 'tag... | true |
Other | laravel | framework | 81053b46ff3a3ebb6571cef2d6ec7c8f7f18deea.json | fix code style | src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php | @@ -307,7 +307,7 @@ public function belongsToMany($related, $table = null, $foreignKey = null, $rela
$relatedKey = $relatedKey ?: $instance->getForeignKey();
- $localKey = $localKey ?: $this->getKeyName();
+ $localKey = $localKey ?: $this->getKeyName();
// If no table name was provided, ... | true |
Other | laravel | framework | 81053b46ff3a3ebb6571cef2d6ec7c8f7f18deea.json | fix code style | src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php | @@ -107,7 +107,7 @@ public function __construct(Builder $query, Model $parent, $table, $foreignKey,
$this->relatedKey = $relatedKey;
$this->foreignKey = $foreignKey;
$this->relationName = $relationName;
- $this->localKey = $localKey;
+ $this->localKey = $localKey;
parent::_... | true |
Other | laravel | framework | 89b296b58b1fd8cd4a1c0e3993f091b5322caaf8.json | Handle model instance in Authorize middleware.
This will help extending Middleware capabilities by giving it directly the Model to check.
Implementation example :
```php
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Middleware\Authorize;
class Author... | src/Illuminate/Auth/Middleware/Authorize.php | @@ -4,6 +4,7 @@
use Closure;
use Illuminate\Contracts\Auth\Access\Gate;
+use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Auth\Factory as Auth;
class Authorize
@@ -70,7 +71,9 @@ protected function getGateArguments($request, $models)
}
return collect($models)->map(function ($m... | true |
Other | laravel | framework | 89b296b58b1fd8cd4a1c0e3993f091b5322caaf8.json | Handle model instance in Authorize middleware.
This will help extending Middleware capabilities by giving it directly the Model to check.
Implementation example :
```php
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Middleware\Authorize;
class Author... | tests/Auth/AuthorizeMiddlewareTest.php | @@ -187,6 +187,28 @@ public function testModelAuthorized()
$this->assertEquals($response->content(), 'success');
}
+ public function testModelInstanceAsParameter()
+ {
+ $instance = m::mock(\Illuminate\Database\Eloquent\Model::class);
+
+ $this->gate()->define('success', function ($u... | true |
Other | laravel | framework | a01bb86c9b17ebb145d3fca50e8017d3387701a5.json | Add missing method to Dispatcher contract (#17893) | src/Illuminate/Contracts/Bus/Dispatcher.php | @@ -28,4 +28,12 @@ public function dispatchNow($command, $handler = null);
* @return $this
*/
public function pipeThrough(array $pipes);
+
+ /**
+ * Retrieve the handler for a command.
+ *
+ * @param mixed $command
+ * @return bool|mixed
+ */
+ public function getCommandHand... | false |
Other | laravel | framework | ec4f39de207ea53f67a14e634ea492849b313c65.json | Replace double quotes with single quotes. | tests/Database/DatabaseQueryBuilderTest.php | @@ -462,8 +462,8 @@ public function testUnions()
$builder = $this->getSQLiteBuilder();
$expectedSql = 'select * from (select "name" from "users" where "id" = ?) union select * from (select "name" from "users" where "id" = ?)';
- $builder->select('name')->from("users")->where('id', '=', 1);
- ... | false |
Other | laravel | framework | 96618d42fec5bd2ddd5aa21c3bef4d7d29f4efba.json | Remove empty line. | tests/Database/DatabaseQueryBuilderTest.php | @@ -466,7 +466,6 @@ public function testUnions()
$builder->union($this->getSQLiteBuilder()->select('name')->from("users")->where('id', '=', 2));
$this->assertEquals($expectedSql, $builder->toSql());
$this->assertEquals([0 => 1, 1 => 2], $builder->getBindings());
-
}
public functio... | false |
Other | laravel | framework | 616baa33e8c2775f2896f062f8a439f8fe8b56b6.json | Remember embedded files to remove duplication | src/Illuminate/Mail/Message.php | @@ -13,6 +13,13 @@ class Message
* @var \Swift_Message
*/
protected $swift;
+
+ /**
+ * CIDs of files embedded in the message.
+ *
+ * @var array
+ */
+ protected $embeddedFiles = [];
/**
* Create a new message instance.
@@ -240,7 +247,15 @@ protected function cre... | false |
Other | laravel | framework | 69f9c4eef64faf473683801b3659e5e4d314e7f3.json | Add tests for assertJsonFragment() (#17873) | tests/Foundation/FoundationTestResponseTest.php | @@ -26,6 +26,25 @@ public function testAssertJsonWithMixed()
$response->assertJson($resource->jsonSerialize());
}
+ public function testAssertJsonFragment()
+ {
+ $response = new TestResponse(new JsonSerializableSingleResourceStub);
+
+ $response->assertJsonFragment(['foo' => 'foo 0'... | false |
Other | laravel | framework | d298373a22f95ab5d13cfdf0cb3b3baa0d90e8f5.json | Fix getUrlRange docblock. (#17859) | src/Illuminate/Contracts/Pagination/LengthAwarePaginator.php | @@ -9,7 +9,7 @@ interface LengthAwarePaginator extends Paginator
*
* @param int $start
* @param int $end
- * @return string
+ * @return array
*/
public function getUrlRange($start, $end);
| true |
Other | laravel | framework | d298373a22f95ab5d13cfdf0cb3b3baa0d90e8f5.json | Fix getUrlRange docblock. (#17859) | src/Illuminate/Pagination/AbstractPaginator.php | @@ -122,7 +122,7 @@ public function previousPageUrl()
*
* @param int $start
* @param int $end
- * @return string
+ * @return array
*/
public function getUrlRange($start, $end)
{ | true |
Other | laravel | framework | bb414d3ad37861a660173221beeea980294b9789.json | Bring the pluralization rules back | src/Illuminate/Translation/MessageSelector.php | @@ -11,9 +11,10 @@ class MessageSelector
*
* @param string $line
* @param int $number
+ * @param string $locale
* @return mixed
*/
- public function choose($line, $number)
+ public function choose($line, $number, $locale)
{
$segments = explode('|', $line);
@... | true |
Other | laravel | framework | bb414d3ad37861a660173221beeea980294b9789.json | Bring the pluralization rules back | src/Illuminate/Translation/Translator.php | @@ -210,7 +210,7 @@ public function choice($key, $number, array $replace = [], $locale = null)
$replace['count'] = $number;
return $this->makeReplacements(
- $this->getSelector()->choose($line, $number), $replace
+ $this->getSelector()->choose($line, $number, $locale), $replace... | true |
Other | laravel | framework | bb414d3ad37861a660173221beeea980294b9789.json | Bring the pluralization rules back | tests/Translation/TranslationMessageSelectorTest.php | @@ -14,7 +14,7 @@ public function testChoose($expected, $id, $number)
{
$selector = new MessageSelector();
- $this->assertEquals($expected, $selector->choose($id, $number));
+ $this->assertEquals($expected, $selector->choose($id, $number, 'en'));
}
public function chooseTestDat... | true |
Other | laravel | framework | bb414d3ad37861a660173221beeea980294b9789.json | Bring the pluralization rules back | tests/Translation/TranslationTranslatorTest.php | @@ -78,7 +78,7 @@ public function testChoiceMethodProperlyLoadsAndRetrievesItem()
$t = $this->getMockBuilder('Illuminate\Translation\Translator')->setMethods(['get'])->setConstructorArgs([$this->getLoader(), 'en'])->getMock();
$t->expects($this->once())->method('get')->with($this->equalTo('foo'), $thi... | true |
Other | laravel | framework | b2d997dcfb73347670e6261f6d6cae3980aa9181.json | Bring the pluralization rules back | src/Illuminate/Translation/MessageSelector.php | @@ -11,9 +11,10 @@ class MessageSelector
*
* @param string $line
* @param int $number
+ * @param string $locale
* @return mixed
*/
- public function choose($line, $number)
+ public function choose($line, $number, $locale)
{
$segments = explode('|', $line);
@... | true |
Other | laravel | framework | b2d997dcfb73347670e6261f6d6cae3980aa9181.json | Bring the pluralization rules back | src/Illuminate/Translation/Translator.php | @@ -210,7 +210,7 @@ public function choice($key, $number, array $replace = [], $locale = null)
$replace['count'] = $number;
return $this->makeReplacements(
- $this->getSelector()->choose($line, $number), $replace
+ $this->getSelector()->choose($line, $number, $locale), $replace... | true |
Other | laravel | framework | b2d997dcfb73347670e6261f6d6cae3980aa9181.json | Bring the pluralization rules back | tests/Translation/TranslationMessageSelectorTest.php | @@ -14,7 +14,7 @@ public function testChoose($expected, $id, $number)
{
$selector = new MessageSelector();
- $this->assertEquals($expected, $selector->choose($id, $number));
+ $this->assertEquals($expected, $selector->choose($id, $number, 'en'));
}
public function chooseTestDat... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.