Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 29, 2016
2 parents 872ca77 + 90791f6 commit 37408ea
Show file tree
Hide file tree
Showing 25 changed files with 425 additions and 80 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG-5.3.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release Notes for 5.3.x

## [Unreleased]
## v5.3.24 (2016-11-21)

### Added
- Added `AuthenticateSession` middleware ([fc302a6](https://github.com/laravel/framework/commit/fc302a6667f9dcce53395d01d8e6ba752ea62955))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function broadcast(array $channels, $event, array $payload = [])
{
$socket = Arr::pull($payload, 'socket');

$response = $this->pusher->trigger($this->formatChannels($channels), $event, $payload, $socket);
$response = $this->pusher->trigger($this->formatChannels($channels), $event, $payload, $socket, true);

if ((is_array($response) && $response['status'] >= 200 && $response['status'] <= 299)
|| $response === true) {
Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Cache/RedisTaggedCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ protected function deleteValues($referenceKey)
$values = array_unique($this->store->connection()->smembers($referenceKey));

if (count($values) > 0) {
call_user_func_array([$this->store->connection(), 'del'], $values);
foreach (array_chunk($values, 1000) as $valuesChunk) {
call_user_func_array([$this->store->connection(), 'del'], $valuesChunk);
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Database/Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,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, $perPage)->get($columns)
: $this->model->newCollection();

return new LengthAwarePaginator($results, $total, $perPage, $page, [
'path' => Paginator::resolveCurrentPath(),
Expand Down
10 changes: 10 additions & 0 deletions src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -2032,6 +2032,16 @@ public function getQualifiedKeyName()
return $this->getTable().'.'.$this->getKeyName();
}

/**
* Get the auto incrementing key type.
*
* @return string
*/
public function getKeyType()
{
return $this->keyType;
}

/**
* Get the value of the model's route key.
*
Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Database/Eloquent/Relations/BelongsTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ protected function getEagerModelKeys(array $models)
// null or 0 in (depending on if incrementing keys are in use) so the query wont
// fail plus returns zero results, which should be what the developer expects.
if (count($keys) === 0) {
return [$this->related->getIncrementing() ? 0 : null];
return [$this->related->getIncrementing() &&
$this->related->getKeyType() === 'int' ? 0 : null, ];
}

return array_values(array_unique($keys));
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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($columns) : collect();

return new LengthAwarePaginator($results, $total, $perPage, $page, [
'path' => Paginator::resolveCurrentPath(),
Expand Down Expand Up @@ -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
*/
Expand Down
16 changes: 16 additions & 0 deletions src/Illuminate/Filesystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,22 @@ public function append($path, $data)
return file_put_contents($path, $data, FILE_APPEND);
}

/**
* Get or set UNIX mode of a file or directory.
*
* @param string $path
* @param int $mode
* @return mixed
*/
public function chmod($path, $mode = null)
{
if ($mode) {
return chmod($path, $mode);
}

return substr(sprintf('%o', fileperms($path)), -4);
}

/**
* Delete the file at a given path.
*
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Notifications/Channels/NexmoSmsChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function send($notifiable, Notification $notification)
}

return $this->nexmo->message()->send([
'type' => $message->type,
'from' => $message->from ?: $this->from,
'to' => $to,
'text' => trim($message->content),
Expand Down
5 changes: 5 additions & 0 deletions src/Illuminate/Notifications/Channels/SlackWebhookChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\SlackMessage;
use Illuminate\Notifications\Messages\SlackAttachment;
use Illuminate\Notifications\Messages\SlackAttachmentField;

class SlackWebhookChannel
{
Expand Down Expand Up @@ -99,6 +100,10 @@ protected function attachments(SlackMessage $message)
protected function fields(SlackAttachment $attachment)
{
return collect($attachment->fields)->map(function ($value, $key) {
if ($value instanceof SlackAttachmentField) {
return $value->toArray();
}

return ['title' => $key, 'value' => $value, 'short' => true];
})->values()->all();
}
Expand Down
19 changes: 19 additions & 0 deletions src/Illuminate/Notifications/Messages/NexmoMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ class NexmoMessage
*/
public $from;

/**
* The message type.
*
* @var string
*/
public $type = 'text';

/**
* Create a new message instance.
*
Expand Down Expand Up @@ -54,4 +61,16 @@ public function from($from)

return $this;
}

/**
* Set the message type.
*
* @return $this
*/
public function unicode()
{
$this->type = 'unicode';

return $this;
}
}
24 changes: 24 additions & 0 deletions src/Illuminate/Notifications/Messages/SlackAttachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,30 @@ public function color($color)
return $this;
}

/**
* Add a field to the attachment.
*
* @param \Closure|array $title
* @param string $content
* @return $this
*/
public function field($title, $content = '')
{
if (is_callable($title)) {
$callback = $title;

$callback($attachmentField = new SlackAttachmentField);

$this->fields[] = $attachmentField;

return $this;
}

$this->fields[$title] = $content;

return $this;
}

/**
* Set the fields of the attachment.
*
Expand Down
79 changes: 79 additions & 0 deletions src/Illuminate/Notifications/Messages/SlackAttachmentField.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php

namespace Illuminate\Notifications\Messages;

class SlackAttachmentField
{
/**
* The title field of the attachment field.
*
* @var string
*/
protected $title;

/**
* The content of the attachment field.
*
* @var string
*/
protected $content;

/**
* Whether the content is short.
*
* @var bool
*/
protected $short = true;

/**
* Set the title of the field.
*
* @param string $title
* @return $this
*/
public function title($title)
{
$this->title = $title;

return $this;
}

/**
* Set the content of the field.
*
* @param string $content
* @return $this
*/
public function content($content)
{
$this->content = $content;

return $this;
}

/**
* Indicates that the content should not be displayed side-by-side with other fields.
*
* @return $this
*/
public function long()
{
$this->short = false;

return $this;
}

/**
* Get the array representation of the attachment field.
*
* @return array
*/
public function toArray()
{
return [
'title' => $this->title,
'value' => $this->content,
'short' => $this->short,
];
}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Support/Facades/Facade.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected static function createFreshMockInstance($name)
* Create a fresh mock instance for the given class.
*
* @param string $name
* @return \Mockery\Expectation
* @return \Mockery\MockInterface
*/
protected static function createMockByName($name)
{
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Support/Pluralizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Pluralizer
'information',
'knowledge',
'love',
'metadata',
'money',
'moose',
'nutrition',
Expand Down
Loading

0 comments on commit 37408ea

Please sign in to comment.