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 | 53ca0c09ddfbc605ec7552e5080b8db067765f84.json | Add join support | src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php | @@ -270,6 +270,27 @@ public function getDateFormat()
return 'Y-m-d H:i:s.000';
}
+ /**
+ * Compile a delete statement into SQL.
+ *
+ * @param \Illuminate\Database\Query\Builder $query
+ * @return string
+ */
+ public function compileDelete(Builder $query)
+ {
+ $ta... | true |
Other | laravel | framework | 53ca0c09ddfbc605ec7552e5080b8db067765f84.json | Add join support | tests/Database/DatabaseQueryBuilderTest.php | @@ -1395,6 +1395,11 @@ public function testDeleteMethod()
$builder->getConnection()->shouldReceive('delete')->once()->with('delete from `users` where `email` = ? order by `id` asc limit 1', ['foo'])->andReturn(1);
$result = $builder->from('users')->where('email', '=', 'foo')->orderBy('id')->take(1)->d... | true |
Other | laravel | framework | 9b5cd619a441dbd436a0353d0f4ddb97288369b5.json | match coding conventions regarding whitespace | src/Illuminate/Foundation/Console/AppNameCommand.php | @@ -224,6 +224,7 @@ protected function setServicesConfigNamespace()
protected function setDatabaseFactoryNamespaces()
{
$modelFactoryFile = $this->laravel->databasePath().'/factories/ModelFactory.php';
+
if ($this->files->exists($modelFactoryFile)) {
$this->replaceIn($modelFacto... | false |
Other | laravel | framework | 481f76000c861e3e2540dcdda986fb44622ccbbe.json | allow array of options on filesystem operations | src/Illuminate/Filesystem/FilesystemAdapter.php | @@ -70,25 +70,23 @@ public function get($path)
*
* @param string $path
* @param string|resource $contents
- * @param string $visibility
+ * @param array $options
* @return bool
*/
- public function put($path, $contents, $visibility = null)
+ public function put($path,... | true |
Other | laravel | framework | 481f76000c861e3e2540dcdda986fb44622ccbbe.json | allow array of options on filesystem operations | src/Illuminate/Http/UploadedFile.php | @@ -2,6 +2,7 @@
namespace Illuminate\Http;
+use Illuminate\Support\Arr;
use Illuminate\Container\Container;
use Illuminate\Support\Traits\Macroable;
use Illuminate\Contracts\Filesystem\Factory as FilesystemFactory;
@@ -15,53 +16,70 @@ class UploadedFile extends SymfonyUploadedFile
* Store the uploaded fil... | true |
Other | laravel | framework | 30016408a6911afba4aa7739d69948d13612ea06.json | add unicode to message | src/Illuminate/Notifications/Channels/NexmoSmsChannel.php | @@ -55,7 +55,7 @@ public function send($notifiable, Notification $notification)
}
return $this->nexmo->message()->send([
- 'type' => 'unicode',
+ 'type' => $message->type,
'from' => $message->from ?: $this->from,
'to' => $to,
'text' => tri... | true |
Other | laravel | framework | 30016408a6911afba4aa7739d69948d13612ea06.json | add unicode to message | src/Illuminate/Notifications/Messages/NexmoMessage.php | @@ -18,6 +18,13 @@ class NexmoMessage
*/
public $from;
+ /**
+ * The message type.
+ *
+ * @var string
+ */
+ public $type = 'text';
+
/**
* Create a new message instance.
*
@@ -54,4 +61,16 @@ public function from($from)
return $this;
}
+
+ /**
+ ... | true |
Other | laravel | framework | 30016408a6911afba4aa7739d69948d13612ea06.json | add unicode to message | tests/Notifications/NotificationNexmoChannelTest.php | @@ -20,6 +20,7 @@ public function testSmsIsSentViaNexmo()
);
$nexmo->shouldReceive('message->send')->with([
+ 'type' => 'text',
'from' => '4444444444',
'to' => '5555555555',
'text' => 'this is my message',
@@ -38,6 +39,7 @@ public function testSmsIsS... | true |
Other | laravel | framework | db4879ae84a3a1959729ac2732ae42cfe377314c.json | fix formatting and tests | src/Illuminate/Notifications/Channels/SlackWebhookChannel.php | @@ -3,10 +3,10 @@
namespace Illuminate\Notifications\Channels;
use GuzzleHttp\Client as HttpClient;
-use Illuminate\Notifications\Messages\SlackAttachmentField;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\SlackMessage;
use Illuminate\Notifications\Messages\SlackAttachment;
+u... | true |
Other | laravel | framework | db4879ae84a3a1959729ac2732ae42cfe377314c.json | fix formatting and tests | src/Illuminate/Notifications/Messages/SlackAttachment.php | @@ -122,9 +122,8 @@ public function field($title, $content = '')
if (is_callable($title)) {
$callback = $title;
- $attachmentField = new SlackAttachmentField();
+ $callback($attachmentField = new SlackAttachmentField);
- $callback($attachmentField);
... | true |
Other | laravel | framework | db4879ae84a3a1959729ac2732ae42cfe377314c.json | fix formatting and tests | src/Illuminate/Notifications/Messages/SlackAttachmentField.php | @@ -19,8 +19,7 @@ class SlackAttachmentField
protected $content;
/**
- * Whether the content is short enough to fit side by side with
- * other contents.
+ * Whether the content is short.
*
* @var bool
*/
@@ -29,7 +28,7 @@ class SlackAttachmentField
/**
* Set the tit... | true |
Other | laravel | framework | db4879ae84a3a1959729ac2732ae42cfe377314c.json | fix formatting and tests | tests/Notifications/NotificationSlackChannelTest.php | @@ -182,7 +182,7 @@ public function toSlack($notifiable)
$attachmentField
->title('Special powers')
->content('Zonda')
- ->dontDisplaySideBySide();
+ ->long();
})... | true |
Other | laravel | framework | 5526aece584c1d21bc6d1a3d9f294aaaa36b3c50.json | Add whereKey method | src/Illuminate/Database/Eloquent/Builder.php | @@ -166,9 +166,7 @@ public function find($id, $columns = ['*'])
return $this->findMany($id, $columns);
}
- $this->query->where($this->model->getQualifiedKeyName(), '=', $id);
-
- return $this->first($columns);
+ return $this->whereKey($id)->first($columns);
}
/**... | false |
Other | laravel | framework | 7aa30020c09373281292872e7e12518934cc76dd.json | Create custom Collection also on empty page | src/Illuminate/Database/Eloquent/Builder.php | @@ -497,7 +497,9 @@ public function paginate($perPage = null, $columns = ['*'], $pageName = 'page',
$total = $query->getCountForPagination();
- $results = $total ? $this->forPage($page, $perPage)->get($columns) : new Collection;
+ $results = $total
+ ? $this->forPage($page, $perPag... | true |
Other | laravel | framework | 7aa30020c09373281292872e7e12518934cc76dd.json | Create custom Collection also on empty page | src/Illuminate/Database/Query/Builder.php | @@ -1663,7 +1663,7 @@ public function paginate($perPage = 15, $columns = ['*'], $pageName = 'page', $p
$total = $this->getCountForPagination($columns);
- $results = $total ? $this->forPage($page, $perPage)->get($columns) : [];
+ $results = $total ? $this->forPage($page, $perPage)->get($column... | true |
Other | laravel | framework | b81cfae9a7090bc02271fa629aa3d2f17715c899.json | add ipv4 and ipv6 validations | src/Illuminate/Validation/Validator.php | @@ -1551,6 +1551,30 @@ protected function validateIp($attribute, $value)
return filter_var($value, FILTER_VALIDATE_IP) !== false;
}
+ /**
+ * Validate that an attribute is a valid IPv4.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ pr... | true |
Other | laravel | framework | b81cfae9a7090bc02271fa629aa3d2f17715c899.json | add ipv4 and ipv6 validations | tests/Validation/ValidationValidatorTest.php | @@ -1505,6 +1505,18 @@ public function testValidateIp()
$v = new Validator($trans, ['ip' => '127.0.0.1'], ['ip' => 'Ip']);
$this->assertTrue($v->passes());
+
+ $v = new Validator($trans, ['ip' => '127.0.0.1'], ['ip' => 'Ipv4']);
+ $this->assertTrue($v->passes());
+
+ $v = new Va... | true |
Other | laravel | framework | b1169e82995a6ea628fd77f44e48c833971a104e.json | fix CS issues | tests/Notifications/NotificationSlackChannelTest.php | @@ -108,7 +108,7 @@ public function testCorrectPayloadWithAttachmentFieldBuilderIsSentToSlack()
'title' => 'Special powers',
'value' => 'Zonda',
'short' => false,
- ]
+ ... | false |
Other | laravel | framework | 8351c8f912ace3523f98d97c83a7695ef0c73d1a.json | fix CS issues | tests/Notifications/NotificationSlackChannelTest.php | @@ -107,7 +107,7 @@ public function testCorrectPayloadWithAttachmentFieldBuilderIsSentToSlack()
[
'title' => 'Special powers',
'value' => 'Zonda',
- 'short' => false
+ ... | false |
Other | laravel | framework | d11cf5f86d90f40c5cb1837cb3820148005517a0.json | Clarify description of method | src/Illuminate/Database/Query/Builder.php | @@ -1730,7 +1730,7 @@ public function getCountForPagination($columns = ['*'])
}
/**
- * Backup some fields for the pagination count.
+ * Backup then remove some fields for the pagination count.
*
* @return void
*/ | false |
Other | laravel | framework | 4f96f429b22b1b09de6a263bd7d50eda18075b52.json | Get the current path formatter. | src/Illuminate/Routing/UrlGenerator.php | @@ -719,6 +719,16 @@ public function formatPathUsing(Closure $callback)
return $this;
}
+ /**
+ * Get the path formatter being used by the URL generator.
+ *
+ * @return \Closure
+ */
+ public function pathFormatter()
+ {
+ return $this->formatPathUsing ?: function ($path... | false |
Other | laravel | framework | 41c99e8e47006b5d2dee6e1d728f824b2b23a392.json | Fix doc block | src/Illuminate/View/FileViewFinder.php | @@ -224,7 +224,7 @@ public function addExtension($extension)
}
/**
- * Returns whether or not the view specify a hint information.
+ * Returns whether or not the view name has any hint information.
*
* @param string $name
* @return bool | false |
Other | laravel | framework | 269521ec9702c320e1f9928e19bfe694759589a3.json | add register name | src/Illuminate/Routing/Router.php | @@ -292,7 +292,7 @@ public function auth()
$this->post('logout', 'Auth\LoginController@logout')->name('logout');
// Registration Routes...
- $this->get('register', 'Auth\RegisterController@showRegistrationForm');
+ $this->get('register', 'Auth\RegisterController@showRegistrationForm')-... | false |
Other | laravel | framework | 11d9c71ee1323d69d8768dd2dea2e045c030729b.json | move deprecated exceptions method to DOCBLOCK | tests/Auth/AuthenticateMiddlewareTest.php | @@ -29,10 +29,11 @@ public function setUp()
});
}
+ /**
+ * @expectedException Illuminate\Auth\AuthenticationException
+ */
public function testDefaultUnauthenticatedThrows()
{
- $this->setExpectedException(AuthenticationException::class);
-
$this->registerAuthDriver... | true |
Other | laravel | framework | 11d9c71ee1323d69d8768dd2dea2e045c030729b.json | move deprecated exceptions method to DOCBLOCK | tests/Auth/AuthorizeMiddlewareTest.php | @@ -9,7 +9,6 @@
use Illuminate\Auth\Middleware\Authorize;
use Illuminate\Contracts\Routing\Registrar;
use Illuminate\Contracts\Auth\Factory as Auth;
-use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Contracts\Auth\Access\Gate as GateContract;
... | true |
Other | laravel | framework | 11d9c71ee1323d69d8768dd2dea2e045c030729b.json | move deprecated exceptions method to DOCBLOCK | tests/Database/DatabaseEloquentBelongsToManyTest.php | @@ -365,13 +365,14 @@ public function testCreateMethodCreatesNewModelAndInsertsAttachmentRecord()
$this->assertEquals($model, $relation->create(['attributes'], ['joining']));
}
+ /**
+ * @expectedException Illuminate\Database\Eloquent\ModelNotFoundException
+ */
public function testFindO... | true |
Other | laravel | framework | 11d9c71ee1323d69d8768dd2dea2e045c030729b.json | move deprecated exceptions method to DOCBLOCK | tests/Database/DatabaseEloquentHasManyThroughTest.php | @@ -174,13 +174,14 @@ public function testFirstMethod()
$this->assertEquals('first', $relation->first());
}
+ /**
+ * @expectedException Illuminate\Database\Eloquent\ModelNotFoundException
+ */
public function testFindOrFailThrowsException()
{
$relation = $this->getMockBuil... | true |
Other | laravel | framework | 11d9c71ee1323d69d8768dd2dea2e045c030729b.json | move deprecated exceptions method to DOCBLOCK | tests/Foundation/FoundationHelpersTest.php | @@ -31,10 +31,11 @@ public function testCache()
$this->assertEquals('default', cache('baz', 'default'));
}
+ /**
+ * @expectedException Exception
+ */
public function testCacheThrowsAnExceptionIfAnExpirationIsNotProvided()
{
- $this->setExpectedException('Exception');
-
... | true |
Other | laravel | framework | 0749932b7914edd551ffa8a8ec420a09b71b325f.json | Fix code style | src/Illuminate/Notifications/Messages/SlackAttachment.php | @@ -158,7 +158,7 @@ public function footer($footer)
public function footerIcon($icon)
{
$this->footerIcon = $icon;
-
+
return $this;
}
| false |
Other | laravel | framework | 81e3c2378fecf7a7861d31f41ec665fecc65ebf7.json | Fix code style | src/Illuminate/Notifications/Messages/SlackAttachment.php | @@ -158,6 +158,7 @@ public function footer($footer)
public function footerIcon($icon)
{
$this->footerIcon = $icon;
+
return $this;
}
| false |
Other | laravel | framework | ab204ff619444ee16882e15d0f70443ebfd299e3.json | Fix code style | src/Illuminate/Notifications/Channels/SlackWebhookChannel.php | @@ -85,7 +85,7 @@ protected function attachments(SlackMessage $message)
'mrkdwn_in' => $attachment->markdown,
'footer' => $attachment->footer,
'footer_icon' => $attachment->footerIcon,
- 'ts' => $attachment->timestamp
+ 'ts' => $attachment... | false |
Other | laravel | framework | 2f7cec4653ba2345561916e3d289543630e551bc.json | Add support for setting attachment’s footer icon | src/Illuminate/Notifications/Channels/SlackWebhookChannel.php | @@ -84,6 +84,7 @@ protected function attachments(SlackMessage $message)
'fields' => $this->fields($attachment),
'mrkdwn_in' => $attachment->markdown,
'footer' => $attachment->footer,
+ 'footer_icon' => $attachment->footerIcon,
'ts' => $a... | true |
Other | laravel | framework | 2f7cec4653ba2345561916e3d289543630e551bc.json | Add support for setting attachment’s footer icon | src/Illuminate/Notifications/Messages/SlackAttachment.php | @@ -55,6 +55,13 @@ class SlackAttachment
*/
public $footer;
+ /**
+ * The attachment's footer icon.
+ *
+ * @var string
+ */
+ public $footerIcon;
+
/**
* The attachment's timestamp.
*
@@ -142,6 +149,18 @@ public function footer($footer)
return $this;
}
... | true |
Other | laravel | framework | f996b9e9627c776b1f385a8f4441f411be7a167b.json | Add support for setting footer of Slack attachment | src/Illuminate/Notifications/Channels/SlackWebhookChannel.php | @@ -83,6 +83,8 @@ protected function attachments(SlackMessage $message)
'title_link' => $attachment->url,
'fields' => $this->fields($attachment),
'mrkdwn_in' => $attachment->markdown,
+ 'footer' => $attachment->footer,
+ 'ts' => $attachmen... | true |
Other | laravel | framework | f996b9e9627c776b1f385a8f4441f411be7a167b.json | Add support for setting footer of Slack attachment | src/Illuminate/Notifications/Messages/SlackAttachment.php | @@ -2,6 +2,8 @@
namespace Illuminate\Notifications\Messages;
+use Carbon\Carbon;
+
class SlackAttachment
{
/**
@@ -46,6 +48,20 @@ class SlackAttachment
*/
public $markdown;
+ /**
+ * The attachment's footer.
+ *
+ * @var string
+ */
+ public $footer;
+
+ /**
+ * The... | true |
Other | laravel | framework | dc0b9def6e2e284f09775139b76bdd1577f75ea9.json | Add support for markdown in Slack attachment | src/Illuminate/Notifications/Channels/SlackWebhookChannel.php | @@ -82,6 +82,7 @@ protected function attachments(SlackMessage $message)
'text' => $attachment->content,
'title_link' => $attachment->url,
'fields' => $this->fields($attachment),
+ 'mrkdwn_in' => $attachment->markdown,
]);
})->all();... | true |
Other | laravel | framework | dc0b9def6e2e284f09775139b76bdd1577f75ea9.json | Add support for markdown in Slack attachment | src/Illuminate/Notifications/Messages/SlackAttachment.php | @@ -39,6 +39,13 @@ class SlackAttachment
*/
public $fields;
+ /**
+ * The fields containing markdown.
+ *
+ * @var array
+ */
+ public $markdown;
+
/**
* Set the title of the attachment.
*
@@ -92,4 +99,17 @@ public function fields(array $fields)
return $thi... | true |
Other | laravel | framework | fcf3b659197413766665be728537cebf0f70af0a.json | Offer an "Attribute Casting" of encrypt
This would allow the user to easily encrypt and decrypt a field by setting it to that `cast`
For example
```
protected $casts = [
'secret' => 'encrypt',
'data' => 'array'
];
``` | src/Illuminate/Database/Eloquent/Model.php | @@ -2793,6 +2793,16 @@ protected function isJsonCastable($key)
return $this->hasCast($key, ['array', 'json', 'object', 'collection']);
}
+ /**
+ * Determine whether a value should be encrypted.
+ *
+ * @param string $key
+ * @return bool
+ */
+ protected function isEncryptCasta... | false |
Other | laravel | framework | 52b182cdff0a115ae31b2c1f03007e73e06e12b3.json | fix docblock type | src/Illuminate/Foundation/helpers.php | @@ -155,9 +155,9 @@ function auth($guard = null)
/**
* Create a new redirect response to the previous location.
*
- * @param int $status
- * @param array $headers
- * @param bool $fallback
+ * @param int $status
+ * @param array $headers
+ * @param string $fallback
... | false |
Other | laravel | framework | 1ab41fb385441494016aeb518b7b809b311e725c.json | Add new JSON loader for translations | src/Illuminate/Foundation/helpers.php | @@ -796,6 +796,21 @@ function trans_choice($id, $number, array $replace = [], $locale = null)
}
}
+if (! function_exists('__')) {
+ /**
+ * Translate the given message.
+ *
+ * @param string $id
+ * @param array $replace
+ * @param string $locale
+ * @return \Illuminate\Contrac... | true |
Other | laravel | framework | 1ab41fb385441494016aeb518b7b809b311e725c.json | Add new JSON loader for translations | src/Illuminate/Translation/FileLoader.php | @@ -50,6 +50,10 @@ public function __construct(Filesystem $files, $path)
*/
public function load($locale, $group, $namespace = null)
{
+ if ($group == '*' && $namespace == '*') {
+ return $this->loadJson($this->path, $locale);
+ }
+
if (is_null($namespace) || $namespace... | true |
Other | laravel | framework | 1ab41fb385441494016aeb518b7b809b311e725c.json | Add new JSON loader for translations | src/Illuminate/Translation/Translator.php | @@ -87,6 +87,33 @@ public function has($key, $locale = null, $fallback = true)
return $this->get($key, [], $locale, $fallback) !== $key;
}
+ /**
+ * Get the JSON translation for a given key.
+ *
+ * @param string $key
+ * @param array $replace
+ * @param string $locale
+ ... | true |
Other | laravel | framework | 1ab41fb385441494016aeb518b7b809b311e725c.json | Add new JSON loader for translations | tests/Translation/TranslationFileLoaderTest.php | @@ -58,4 +58,13 @@ public function testEmptyArraysReturnedWhenFilesDontExistForNamespacedItems()
$this->assertEquals([], $loader->load('en', 'foo', 'bar'));
}
+
+ public function testLoadMethodForJSONProperlyCallsLoader()
+ {
+ $loader = new FileLoader($files = m::mock('Illuminate\Filesyste... | true |
Other | laravel | framework | 1ab41fb385441494016aeb518b7b809b311e725c.json | Add new JSON loader for translations | tests/Translation/TranslationTranslatorTest.php | @@ -94,6 +94,52 @@ public function testChoiceMethodProperlyCountsCollectionsAndLoadsAndRetrievesIte
$t->choice('foo', $values, ['replace']);
}
+ public function testGetJsonMethod()
+ {
+ $t = new Illuminate\Translation\Translator($this->getLoader(), 'en');
+ $t->getLoader()->shouldRe... | true |
Other | laravel | framework | fc302a6667f9dcce53395d01d8e6ba752ea62955.json | Add AuthenticateSession middleware. | src/Illuminate/Foundation/Http/Kernel.php | @@ -75,6 +75,7 @@ class Kernel implements KernelContract
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\Illuminate\Auth\Middleware\Authenticate::class,
+ \Illuminate\Session\Middleware\AuthenticateSession::class,
... | true |
Other | laravel | framework | fc302a6667f9dcce53395d01d8e6ba752ea62955.json | Add AuthenticateSession middleware. | src/Illuminate/Session/Middleware/AuthenticateSession.php | @@ -0,0 +1,88 @@
+<?php
+
+namespace Illuminate\Session\Middleware;
+
+use Closure;
+use Illuminate\Auth\AuthenticationException;
+use Illuminate\Contracts\Auth\Factory as AuthFactory;
+
+class AuthenticateSession
+{
+ /**
+ * The authentication factory implementation.
+ *
+ * @var \Illuminate\Contracts\... | true |
Other | laravel | framework | 2ce1ed4eca81574d6929e350d5b9a6444797a0bb.json | add return statement | src/Illuminate/Queue/SyncQueue.php | @@ -56,6 +56,7 @@ public function push($job, $data = '', $queue = null)
*
* @param \Illuminate\Queue\Jobs\Job $queueJob
* @param \Exception $e
+ * @return void
*
* @throws \Exception
*/ | false |
Other | laravel | framework | 1ad9a66b93f82ce2a21f651620818f4557682d68.json | Remove unused imports | src/Illuminate/Database/Connectors/ConnectionFactory.php | @@ -2,7 +2,6 @@
namespace Illuminate\Database\Connectors;
-use PDO;
use PDOException;
use Illuminate\Support\Arr;
use InvalidArgumentException; | true |
Other | laravel | framework | 1ad9a66b93f82ce2a21f651620818f4557682d68.json | Remove unused imports | src/Illuminate/Database/Eloquent/Model.php | @@ -3,7 +3,6 @@
namespace Illuminate\Database\Eloquent;
use Closure;
-use DateTime;
use Exception;
use ArrayAccess;
use Carbon\Carbon; | true |
Other | laravel | framework | 1ad9a66b93f82ce2a21f651620818f4557682d68.json | Remove unused imports | src/Illuminate/Database/Eloquent/Relations/HasOne.php | @@ -2,7 +2,6 @@
namespace Illuminate\Database\Eloquent\Relations;
-use Closure;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Collection;
| true |
Other | laravel | framework | 1ad9a66b93f82ce2a21f651620818f4557682d68.json | Remove unused imports | src/Illuminate/Mail/Jobs/HandleQueuedMessage.php | @@ -5,7 +5,6 @@
use Closure;
use Illuminate\Support\Str;
use SuperClosure\Serializer;
-use Illuminate\Contracts\Queue\Job;
use Illuminate\Contracts\Mail\Mailer;
use Illuminate\Queue\SerializesAndRestoresModelIdentifiers;
| true |
Other | laravel | framework | 1ad9a66b93f82ce2a21f651620818f4557682d68.json | Remove unused imports | src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php | @@ -3,7 +3,6 @@
namespace Illuminate\Notifications\Events;
use Illuminate\Queue\SerializesModels;
-use Illuminate\Notifications\Notification;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
| true |
Other | laravel | framework | 1ad9a66b93f82ce2a21f651620818f4557682d68.json | Remove unused imports | src/Illuminate/Queue/Worker.php | @@ -4,7 +4,6 @@
use Exception;
use Throwable;
-use Illuminate\Contracts\Queue\Job;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Symfony\Component\Debug\Exception\FatalThrowableError; | true |
Other | laravel | framework | dc5f1317364ac426b326052c213742b48316cb99.json | throw broadcast exception | src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php | @@ -3,9 +3,9 @@
namespace Illuminate\Broadcasting\Broadcasters;
use Pusher;
-use RuntimeException;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
+use Illuminate\Broadcasting\BroadcastException;
use Symfony\Component\HttpKernel\Exception\HttpException;
class PusherBroadcaster extends Broadcaster
@@ -... | false |
Other | laravel | framework | 67e7beb119b40abf31a65affa0abe0c9cb9463ac.json | Throw exception on Pusher broadcaster error | src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php | @@ -3,6 +3,7 @@
namespace Illuminate\Broadcasting\Broadcasters;
use Pusher;
+use RuntimeException;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Symfony\Component\HttpKernel\Exception\HttpException;
@@ -90,7 +91,13 @@ public function broadcast(array $channels, $event, array $payload = [])
{
... | false |
Other | laravel | framework | adabe9a6b78e71f661da7f58ba36970d63295e8e.json | Use Blade instead of raw PHP to display JSON | src/Illuminate/Auth/Console/stubs/make/views/layouts/app.stub | @@ -15,10 +15,9 @@
<!-- Scripts -->
<script>
- window.Laravel = <?php echo json_encode([
+ window.Laravel = {!! json_encode([
'csrfToken' => csrf_token(),
- ]); ?>
-
+ ]) !!};
</script>
</head>
<body> | false |
Other | laravel | framework | efc38817413c92213e3268d3b109daa74211f446.json | Fix foreign key issue when primary key is not 'id' | src/Illuminate/Database/Eloquent/Model.php | @@ -2128,7 +2128,7 @@ public function setPerPage($perPage)
*/
public function getForeignKey()
{
- return Str::snake(class_basename($this)).'_id';
+ return Str::snake(class_basename($this)).'_'.$this->primaryKey;
}
/** | false |
Other | laravel | framework | 84842c1d845cd01a2def163539204cbc15a59821.json | Allow SlackAttachment color override (#16360)
* Add color to SlackAttachment
* Allow override of Slack Attachment color | src/Illuminate/Notifications/Channels/SlackWebhookChannel.php | @@ -77,7 +77,7 @@ protected function attachments(SlackMessage $message)
{
return collect($message->attachments)->map(function ($attachment) use ($message) {
return array_filter([
- 'color' => $message->color(),
+ 'color' => $attachment->color ?: $message->color()... | true |
Other | laravel | framework | 84842c1d845cd01a2def163539204cbc15a59821.json | Allow SlackAttachment color override (#16360)
* Add color to SlackAttachment
* Allow override of Slack Attachment color | src/Illuminate/Notifications/Messages/SlackAttachment.php | @@ -25,6 +25,13 @@ class SlackAttachment
*/
public $content;
+ /**
+ * The attachment's color.
+ *
+ * @var string
+ */
+ public $color;
+
/**
* The attachment's fields.
*
@@ -60,6 +67,19 @@ public function content($content)
return $this;
}
+ /**
+ ... | true |
Other | laravel | framework | 57be173daca2e85964b02f50d5de2fa7c83bdbdb.json | Add doc-block for code auto-complete (#16341)
Add doc-block Illuminate\Database\Eloquent\Builder for code auto-complete in PhpStorm | src/Illuminate/Database/Eloquent/Builder.php | @@ -12,6 +12,9 @@
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder as QueryBuilder;
+/**
+ * @mixin \Illuminate\Database\Query\Builder
+ */
class Builder
{
/** | false |
Other | laravel | framework | c2e4b5c000961800650f8ef6b40160ff664261f5.json | Catch Throwable in timezone validation (#16344) | src/Illuminate/Validation/Validator.php | @@ -6,6 +6,7 @@
use DateTime;
use Countable;
use Exception;
+use Throwable;
use DateTimeZone;
use RuntimeException;
use DateTimeInterface;
@@ -1976,6 +1977,8 @@ protected function validateTimezone($attribute, $value)
new DateTimeZone($value);
} catch (Exception $e) {
return fals... | true |
Other | laravel | framework | c2e4b5c000961800650f8ef6b40160ff664261f5.json | Catch Throwable in timezone validation (#16344) | tests/Validation/ValidationValidatorTest.php | @@ -2063,6 +2063,9 @@ public function testValidateTimezone()
$v = new Validator($trans, ['foo' => 'GMT'], ['foo' => 'Timezone']);
$this->assertTrue($v->passes());
+
+ $v = new Validator($trans, ['foo' => ['this_is_not_a_timezone']], ['foo' => 'Timezone']);
+ $this->assertFalse($v->pass... | true |
Other | laravel | framework | 6b906e3d45d023a7432f3f509bc9509d1f9bf2e3.json | escape the delimiter before preg_match (#16309) | src/Illuminate/Validation/Validator.php | @@ -2790,7 +2790,7 @@ protected function dependsOnOtherFields($rule)
*/
protected function getExplicitKeys($attribute)
{
- $pattern = str_replace('\*', '([^\.]+)', preg_quote($this->getPrimaryAttribute($attribute)));
+ $pattern = str_replace('\*', '([^\.]+)', preg_quote($this->getPrimaryAt... | false |
Other | laravel | framework | 8c8eb21546b1ae949c459c244d8188308e423f69.json | use forceReconnection method (#16298) | src/Illuminate/Mail/Mailer.php | @@ -373,7 +373,7 @@ protected function sendSwiftMessage($message)
try {
return $this->swift->send($message, $this->failedRecipients);
} finally {
- $this->swift->getTransport()->stop();
+ $this->forceReconnection();
}
}
| false |
Other | laravel | framework | 9f19107fe952aac76560a694d580b5ca328323e9.json | Fix CookieJar::queue() method signature | src/Illuminate/Contracts/Cookie/QueueingFactory.php | @@ -7,9 +7,11 @@ interface QueueingFactory extends Factory
/**
* Queue a cookie to send with the next response.
*
+ * @param array $params
+ *
* @return void
*/
- public function queue();
+ public function queue(...$params);
/**
* Remove a cookie from the queue. | true |
Other | laravel | framework | 9f19107fe952aac76560a694d580b5ca328323e9.json | Fix CookieJar::queue() method signature | src/Illuminate/Cookie/CookieJar.php | @@ -113,14 +113,16 @@ public function queued($key, $default = null)
/**
* Queue a cookie to send with the next response.
*
+ * @param array $params
+ *
* @return void
*/
- public function queue()
+ public function queue(...$params)
{
- if (head(func_get_args()) i... | true |
Other | laravel | framework | 2dcf1a0f9b767a937fbcad0af5f96cbe1856f85f.json | Fix some docblocks
Also, updated the receiveJson type hint | src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php | @@ -7,7 +7,7 @@ trait InteractsWithAuthentication
/**
* Assert that the user is authenticated.
*
- * @param string|null $guard
+ * @param string|null $guard
* @return $this
*/
public function seeIsAuthenticated($guard = null)
@@ -100,7 +100,7 @@ public function dontSeeCreden... | true |
Other | laravel | framework | 2dcf1a0f9b767a937fbcad0af5f96cbe1856f85f.json | Fix some docblocks
Also, updated the receiveJson type hint | src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php | @@ -16,8 +16,8 @@ trait InteractsWithConsole
/**
* Call artisan command and return code.
*
- * @param string $command
- * @param array $parameters
+ * @param string $command
+ * @param array $parameters
* @return int
*/
public function artisan($command, $paramete... | true |
Other | laravel | framework | 2dcf1a0f9b767a937fbcad0af5f96cbe1856f85f.json | Fix some docblocks
Also, updated the receiveJson type hint | src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php | @@ -118,8 +118,8 @@ public function get($uri, array $headers = [])
/**
* Visit the given URI with a GET request, expecting a JSON response.
*
- * @param string $uri
- * @param array $headers
+ * @param string $uri
+ * @param array $headers
* @return $this
*/
public ... | true |
Other | laravel | framework | 2dcf1a0f9b767a937fbcad0af5f96cbe1856f85f.json | Fix some docblocks
Also, updated the receiveJson type hint | tests/Database/DatabaseMigrationRefreshCommandTest.php | @@ -69,7 +69,7 @@ protected function runCommand($command, $input = [])
class InputMatcher extends m\Matcher\MatcherAbstract
{
/**
- * @param \Symfony\Component\Console\Input\ArrayInput $actual
+ * @param \Symfony\Component\Console\Input\ArrayInput $actual
* @return bool
*/
public func... | true |
Other | laravel | framework | ee385fa5eab0c4642f47636f0e033e982d402bb9.json | use tries as the property | src/Illuminate/Queue/Jobs/Job.php | @@ -239,9 +239,9 @@ public function payload()
*
* @return int|null
*/
- public function retries()
+ public function maxTries()
{
- return array_get($this->payload(), 'retries');
+ return array_get($this->payload(), 'maxTries');
}
/** | true |
Other | laravel | framework | ee385fa5eab0c4642f47636f0e033e982d402bb9.json | use tries as the property | src/Illuminate/Queue/Queue.php | @@ -81,7 +81,7 @@ protected function createPayload($job, $data = '', $queue = null)
if (is_object($job)) {
$payload = json_encode([
'job' => 'Illuminate\Queue\CallQueuedHandler@call',
- 'retries' => isset($job->retries) ? $job->retries : null,
+ 'maxT... | true |
Other | laravel | framework | ee385fa5eab0c4642f47636f0e033e982d402bb9.json | use tries as the property | src/Illuminate/Queue/Worker.php | @@ -281,7 +281,7 @@ protected function handleJobException($connectionName, $job, WorkerOptions $opti
*/
protected function markJobAsFailedIfAlreadyExceedsMaxAttempts($connectionName, $job, $maxTries)
{
- $maxTries = ! is_null($job->retries()) ? $job->retries() : $maxTries;
+ $maxTries = ! ... | true |
Other | laravel | framework | ee385fa5eab0c4642f47636f0e033e982d402bb9.json | use tries as the property | tests/Queue/QueueWorkerTest.php | @@ -136,7 +136,7 @@ public function test_job_based_max_retries()
});
$job->attempts = 2;
- $job->retries = 10;
+ $job->maxTries = 10;
$worker = $this->getWorker('default', ['queue' => [$job]]);
$worker->runNextJob('default', 'queue', $this->workerOptions(['maxTries'... | true |
Other | laravel | framework | 2382dc3f374bee7ad966d11ecb35a1429d9a09e8.json | tweak a few things | src/Illuminate/Queue/Jobs/Job.php | @@ -15,13 +15,6 @@ abstract class Job
*/
protected $instance;
- /**
- * The command instance.
- *
- * @var mixed
- */
- protected $command;
-
/**
* The IoC container instance.
*
@@ -241,41 +234,24 @@ public function payload()
return json_decode($this->getRawB... | true |
Other | laravel | framework | 2382dc3f374bee7ad966d11ecb35a1429d9a09e8.json | tweak a few things | src/Illuminate/Queue/Queue.php | @@ -81,6 +81,8 @@ protected function createPayload($job, $data = '', $queue = null)
if (is_object($job)) {
$payload = json_encode([
'job' => 'Illuminate\Queue\CallQueuedHandler@call',
+ 'retries' => isset($job->retries) ? $job->retries : null,
+ 'time... | true |
Other | laravel | framework | 2382dc3f374bee7ad966d11ecb35a1429d9a09e8.json | tweak a few things | src/Illuminate/Queue/Worker.php | @@ -102,7 +102,7 @@ protected function registerTimeoutHandler($job, WorkerOptions $options)
return;
}
- $timeout = $job && $job->timeout() !== null ? $job->timeout() : $options->timeout;
+ $timeout = $job && ! is_null($job->timeout()) ? $job->timeout() : $options->timeout;
... | true |
Other | laravel | framework | 57ba218e1dd4a543f24623b1b4e3e89b5e690469.json | Fix chunk test when negative value (#16246) | tests/Support/SupportCollectionTest.php | @@ -698,7 +698,7 @@ public function testChunkWhenGivenLessThanZero()
$this->assertEquals(
[],
- $collection->chunk(0)->toArray()
+ $collection->chunk(-1)->toArray()
);
}
| false |
Other | laravel | framework | 799164513891a258e858061fc7f86a415cb38821.json | Add hook functions and tests | src/Illuminate/Validation/ValidatesWhenResolvedTrait.php | @@ -14,13 +14,15 @@ trait ValidatesWhenResolvedTrait
*/
public function validate()
{
+ $this->beforeValidation();
$instance = $this->getValidatorInstance();
if (! $this->passesAuthorization()) {
$this->failedAuthorization();
} elseif (! $instance->passes(... | true |
Other | laravel | framework | 799164513891a258e858061fc7f86a415cb38821.json | Add hook functions and tests | tests/Foundation/FoundationFormRequestTest.php | @@ -76,6 +76,35 @@ public function testRedirectResponseIsProperlyCreatedWithGivenErrors()
$request->response(['errors']);
}
+
+ public function testValidateFunctionRunsBeforeValidationFunction()
+ {
+ $request = FoundationTestFormRequestHooks::create('/', 'GET', ['name' => 'abigail']);
+ ... | true |
Other | laravel | framework | 2f2da143b27e5d2522c76e8e2c0bf0c9e9f79f02.json | Fix Translator::sortReplacements (#16221) | src/Illuminate/Translation/Translator.php | @@ -198,7 +198,7 @@ protected function sortReplacements(array $replace)
{
return (new Collection($replace))->sortBy(function ($value, $key) {
return mb_strlen($key) * -1;
- });
+ })->all();
}
/** | false |
Other | laravel | framework | 5d8d7bab941e19894400a5cda5a61b81828b98ae.json | Remove merge comments | src/Illuminate/Queue/Worker.php | @@ -235,11 +235,6 @@ protected function handleJobException($connectionName, $job, WorkerOptions $opti
$this->raiseExceptionOccurredJobEvent(
$connectionName, $job, $e
);
-<<<<<<< HEAD
-=======
- } catch (Exception $exception) {
- $this->raiseFailedJobEvent($c... | false |
Other | laravel | framework | c1de4911bba6ad3b273106f3af26b14bafc8a204.json | Try catch failJob
failJob gets called from 2 separate places. Better to put this code
around a try catch instead of in the try catch in handleJobException | src/Illuminate/Queue/Worker.php | @@ -3,6 +3,7 @@
namespace Illuminate\Queue;
use Exception;
+use RuntimeException;
use Throwable;
use Illuminate\Contracts\Queue\Job;
use Illuminate\Contracts\Events\Dispatcher;
@@ -234,8 +235,6 @@ protected function handleJobException($connectionName, $job, WorkerOptions $opti
$this->raiseExceptionO... | false |
Other | laravel | framework | f2c1253fc2aae9df160f6cc8686196066083c0d4.json | Fix docblock typo. (#16199) | src/Illuminate/Database/Query/Grammars/Grammar.php | @@ -824,7 +824,7 @@ protected function removeLeadingBoolean($value)
}
/**
- * Get the gramar specific operators.
+ * Get the grammar specific operators.
*
* @return array
*/ | false |
Other | laravel | framework | 2d301e31203eb6fa2364b3857d2fd4f4a0e85ea1.json | Use UUID for generating file names | src/Illuminate/Http/FileHelpers.php | @@ -46,6 +46,6 @@ public function hashName($path = null)
$path = rtrim($path, '/').'/';
}
- return $path.md5_file($this->getRealPath()).'.'.$this->guessExtension();
+ return $path.Uuid::uuid4()->toString().'.'.$this->guessExtension();
}
} | false |
Other | laravel | framework | c460b69aa1be9838ea8c74c80417c92444677772.json | change method order | src/Illuminate/Notifications/HasDatabaseNotifications.php | @@ -14,22 +14,22 @@ public function notifications()
}
/**
- * Get the entity's unread notifications.
+ * Get the entity's read notifications.
*/
- public function unreadNotifications()
+ public function readNotifications()
{
return $this->morphMany(DatabaseNotification::cla... | false |
Other | laravel | framework | 148564c49fd55be19ffb00d6cc506a232bec413d.json | Add test when last chunk is complete | tests/Database/DatabaseEloquentBuilderTest.php | @@ -154,7 +154,28 @@ public function testValueMethodWithModelNotFound()
$this->assertNull($builder->value('name'));
}
- public function testChunkExecuteCallbackOverPaginatedRequest()
+ public function testChunkWithLastChunkComplete()
+ {
+ $builder = m::mock('Illuminate\Database\Eloquent... | false |
Other | laravel | framework | 2da3d433e57975198c9c3f4d000e8bf6359ceddb.json | add file to optimize | src/Illuminate/Foundation/Console/Optimize/config.php | @@ -20,6 +20,7 @@
$basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Cookie/QueueingFactory.php',
$basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Encryption/Encrypter.php',
$basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Queue/QueueableEntity.php',
+ $basePath.'/... | false |
Other | laravel | framework | 03e44e6406dd0c8cf9de94e1ed58db586858bc24.json | add option shortcut 'r' for resource. (#16141) | src/Illuminate/Routing/Console/ControllerMakeCommand.php | @@ -61,7 +61,7 @@ protected function getDefaultNamespace($rootNamespace)
protected function getOptions()
{
return [
- ['resource', null, InputOption::VALUE_NONE, 'Generate a resource controller class.'],
+ ['resource', 'r', InputOption::VALUE_NONE, 'Generate a resource controlle... | false |
Other | laravel | framework | e5697d5f0c244b443a7622328a6d3d99b93dbe72.json | Remove duplicate useless empty lines. (#16130) | tests/Validation/ValidationExistsRuleTest.php | @@ -8,7 +8,6 @@ public function testItCorrectlyFormatsAStringVersionOfTheRule()
$rule->where('foo', 'bar');
$this->assertEquals('exists:table,NULL,foo,bar', (string) $rule);
-
$rule = new Illuminate\Validation\Rules\Exists('table', 'column');
$rule->where('foo', 'bar');
$t... | true |
Other | laravel | framework | e5697d5f0c244b443a7622328a6d3d99b93dbe72.json | Remove duplicate useless empty lines. (#16130) | tests/Validation/ValidationUniqueRuleTest.php | @@ -8,7 +8,6 @@ public function testItCorrectlyFormatsAStringVersionOfTheRule()
$rule->where('foo', 'bar');
$this->assertEquals('unique:table,NULL,NULL,id,foo,bar', (string) $rule);
-
$rule = new Illuminate\Validation\Rules\Unique('table', 'column');
$rule->ignore(1, 'id_column');
... | true |
Other | laravel | framework | e5697d5f0c244b443a7622328a6d3d99b93dbe72.json | Remove duplicate useless empty lines. (#16130) | tests/Validation/ValidationValidatorTest.php | @@ -1424,7 +1424,6 @@ public function testValidateUniqueAndExistsSendsCorrectFieldNameToDBWithArrays()
$v->setPresenceVerifier($mock);
$this->assertTrue($v->passes());
-
$trans = $this->getIlluminateArrayTranslator();
$closure = function () {
}; | true |
Other | laravel | framework | 08ee66ade116f6ba1cc743dd36210bfdfbd196ea.json | Fix incorrect return value | src/Illuminate/Validation/Rule.php | @@ -46,7 +46,7 @@ public static function in(array $values)
* Get a not_in constraint builder instance.
*
* @param array $values
- * @return \Illuminate\Validation\Rules\In
+ * @return \Illuminate\Validation\Rules\NotIn
*/
public static function notIn(array $values)
{ | false |
Other | laravel | framework | e9ed079a6a3b51508273488c1f90fe95a47e9dcc.json | Fix empty session (#15998)
Fix session being empty when the file is being read and/or written by multiple instance of apache simultaneously. This append to me when assets (javascript / css) are being loaded dynamically using php. Multiples assets in the same request cause the sessions to be corrupted. | src/Illuminate/Session/FileSessionHandler.php | @@ -68,7 +68,7 @@ public function read($sessionId)
{
if ($this->files->exists($path = $this->path.'/'.$sessionId)) {
if (filemtime($path) >= Carbon::now()->subMinutes($this->minutes)->getTimestamp()) {
- return $this->files->get($path);
+ return $this->files->get... | false |
Other | laravel | framework | 18d26df24f1f3b17bd20c7244d9b85d273138d79.json | Fix UUIDs when queueing. | src/Illuminate/Notifications/ChannelManager.php | @@ -68,7 +68,9 @@ public function sendNow($notifiables, $notification, array $channels = null)
foreach ($channels as $channel) {
$notification = clone $original;
- $notification->id = $notificationId;
+ if (! $notification->id) {
+ $notifi... | false |
Other | laravel | framework | 810311e3309ab0c1672af94a3ead1aab9200f330.json | Fix improper use of mb_substr() (#16081) | src/Illuminate/Routing/UrlGenerator.php | @@ -171,8 +171,8 @@ public function to($path, $extra = [], $secure = null)
$root = $this->getRootUrl($scheme);
if (($queryPosition = strpos($path, '?')) !== false) {
- $query = mb_substr($path, $queryPosition);
- $path = mb_substr($path, 0, $queryPosition);
+ $query ... | false |
Other | laravel | framework | 415724e94e696ce90755cf0374547982f26b9e07.json | Fix typo in doc block. | src/Illuminate/Notifications/ChannelManager.php | @@ -102,7 +102,7 @@ protected function shouldSendNotification($notifiable, $notification, $channel)
* Queue the given notification instances.
*
* @param mixed $notifiables
- * @param array[\Illuminate\Notifcations\Channels\Notification] $notification
+ * @param array[\Illuminate\Notificat... | false |
Other | laravel | framework | dadc76237b58ded295fa5459b1d7a9e4e6f4f33a.json | Add registered method (#16036)
call to registered method just like what AuthenticatesUsers Trait does to authenticated. | src/Illuminate/Foundation/Auth/RegistersUsers.php | @@ -34,7 +34,8 @@ public function register(Request $request)
$this->guard()->login($user);
- return redirect($this->redirectPath());
+ return $this->registered($request, $user)
+ ?: redirect($this->redirectPath());
}
/**
@@ -46,4 +47,16 @@ protected function guard()
... | false |
Other | laravel | framework | 9adce329ede8750b92dd96eb791434e0cf9aa7e2.json | Update ListenerMakeCommand.php (#16038) | src/Illuminate/Foundation/Console/ListenerMakeCommand.php | @@ -114,9 +114,9 @@ protected function getDefaultNamespace($rootNamespace)
protected function getOptions()
{
return [
- ['event', null, InputOption::VALUE_REQUIRED, 'The event class being listened for.'],
+ ['event', 'e', InputOption::VALUE_REQUIRED, 'The event class being liste... | false |
Other | laravel | framework | 1a0930650601cbcbbaf4b4ede904bd147e0f461f.json | Use bootstrappers instead of events | src/Illuminate/Console/Application.php | @@ -27,6 +27,13 @@ class Application extends SymfonyApplication implements ApplicationContract
*/
protected $lastOutput;
+ /**
+ * The console application bootstrappers.
+ *
+ * @var array
+ */
+ protected static $bootstrappers = [];
+
/**
* Create a new Artisan console app... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.