Change joins with a collection to use collection joins

This commit is contained in:
Deon George 2021-08-14 11:22:45 +10:00
parent 6db826c8a4
commit 6c6976678f
8 changed files with 12 additions and 12 deletions

View File

@ -394,7 +394,7 @@ class Message extends FTNBase
{ {
$return = ''; $return = '';
$return .= pack(join('',collect(self::header)->pluck(1)->toArray()), $return .= pack(collect(self::header)->pluck(1)->join(''),
$this->ff, $this->ff,
$this->tf, $this->tf,
$this->fn, $this->fn,
@ -723,7 +723,7 @@ class Message extends FTNBase
'flags' => 'required|numeric', 'flags' => 'required|numeric',
'cost' => 'required|numeric', 'cost' => 'required|numeric',
'echoarea' => 'nullable|max:'.self::AREATAG_LEN, 'echoarea' => 'nullable|max:'.self::AREATAG_LEN,
'ozone' => ['required',$this->domain ? 'in:'.$x=join(',',$this->domain->zones->pluck('zone_id')->toArray()): ''], 'ozone' => ['required',$this->domain ? 'in:'.$x=$this->domain->zones->pluck('zone_id')->join(','): ''],
'dzone' => ['required',$this->domain ? 'in:'.$x : ''] 'dzone' => ['required',$this->domain ? 'in:'.$x : '']
]); ]);

View File

@ -269,7 +269,7 @@ class Packet extends FTNBase
private function createHeader(): string private function createHeader(): string
{ {
try { try {
$a = pack(join('',collect(self::v2header)->pluck(1)->toArray()), $a = pack(collect(self::v2header)->pluck(1)->join(''),
$this->ff, $this->ff,
$this->tf, $this->tf,
Arr::get($this->header,'y'), Arr::get($this->header,'y'),

View File

@ -144,7 +144,7 @@ final class Binkp extends BaseProtocol
// If we are originating, we'll show the remote our address in the same network // If we are originating, we'll show the remote our address in the same network
// @todo Implement hiding our AKAs not in this network. // @todo Implement hiding our AKAs not in this network.
if ($this->originate) if ($this->originate)
$this->msgs(self::BPM_ADR,join(' ',$this->setup->system->addresses->pluck('ftn')->toArray())); $this->msgs(self::BPM_ADR,$this->setup->system->addresses->pluck('ftn')->join(' '));
} }
/** /**
@ -667,7 +667,7 @@ final class Binkp extends BaseProtocol
// If we are not the originator, we'll show our addresses in common. // If we are not the originator, we'll show our addresses in common.
// @todo make this an option to hideAKAs or not // @todo make this an option to hideAKAs or not
if (! $this->originate) if (! $this->originate)
$this->msgs(self::BPM_ADR,join(' ',$this->setup->system->addresses->pluck('ftn')->toArray())); $this->msgs(self::BPM_ADR,$this->setup->system->addresses->pluck('ftn')->join(' '));
return 1; return 1;
} }

View File

@ -184,7 +184,7 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
// Site address, password and compatibility // Site address, password and compatibility
// @todo Only show the AKAs that is relevant to the node we are connecting to // @todo Only show the AKAs that is relevant to the node we are connecting to
$makedata .= sprintf('{EMSI}{%s}{%s}{%s}{%s}', $makedata .= sprintf('{EMSI}{%s}{%s}{%s}{%s}',
join(' ',$this->setup->system->addresses->pluck('ftn')->toArray()), $this->setup->system->addresses->pluck('ftn')->join(' '),
$this->node->password == '-' ? '' : $this->node->password, $this->node->password == '-' ? '' : $this->node->password,
join(',',$link_codes), join(',',$link_codes),
join(',',$compat_codes), join(',',$compat_codes),

View File

@ -42,7 +42,7 @@
<td>{{ $oo->name }}</td> <td>{{ $oo->name }}</td>
<td>{{ $oo->active ? 'YES' : 'NO' }}</td> <td>{{ $oo->active ? 'YES' : 'NO' }}</td>
<td>{{ $oo->dnsdomain }}</td> <td>{{ $oo->dnsdomain }}</td>
<td>{{ join(', ',$oo->zones->pluck('zone_id')->sort()->toArray()) }}</td> <td>{{ $oo->zones->pluck('zone_id')->sort()->join(', ') }}</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>

View File

@ -112,19 +112,19 @@
@if($msg->isNetmail()) @if($msg->isNetmail())
<div class="row pb-2"> <div class="row pb-2">
<div class="col-8"> <div class="col-8">
VIA: <br><strong class="highlight">{!! join('</strong><br><strong class="highlight">',$msg->via->toArray()) !!}</strong> VIA: <br><strong class="highlight">{!! $msg->via->join('</strong><br><strong class="highlight">') !!}</strong>
</div> </div>
</div> </div>
@else @else
<div class="row pb-2"> <div class="row pb-2">
<div class="col-8"> <div class="col-8">
SEENBY: <br><strong class="highlight">{!! join('</strong><br><strong class="highlight">',$msg->seenby->toArray()) !!}</strong> SEENBY: <br><strong class="highlight">{!! $msg->seenby->join('</strong><br><strong class="highlight">') !!}</strong>
</div> </div>
</div> </div>
<div class="row pb-2"> <div class="row pb-2">
<div class="col-8"> <div class="col-8">
PATH: <br><strong class="highlight">{!! join('</strong><br><strong class="highlight">',$msg->path->toArray()) !!}</strong> PATH: <br><strong class="highlight">{!! $msg->path->join('</strong><br><strong class="highlight">') !!}</strong>
</div> </div>
</div> </div>
@endif @endif

View File

@ -62,7 +62,7 @@ use App\Models\Setup;
@foreach ($o->system->addresses->groupBy('zone_id') as $zones) @foreach ($o->system->addresses->groupBy('zone_id') as $zones)
<tr> <tr>
<th>{{ $zones->first()->zone->domain->name }}</th> <th>{{ $zones->first()->zone->domain->name }}</th>
<th class="text-end">{!! join('<br>',$zones->pluck('ftn')->toArray()) !!}</th> <th class="text-end">{!! $zones->pluck('ftn')->join('<br>') !!}</th>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>

View File

@ -50,7 +50,7 @@
@default No details @default No details
@endswitch @endswitch
</td> </td>
<td>{{ join(',',$oo->addresses->pluck('ftn')->toArray()) }}</td> <td>{{ $oo->addresses->pluck('ftn')->join(', ') }}</td>
<td>{{ $oo->zt_id }}</td> <td>{{ $oo->zt_id }}</td>
</tr> </tr>
@endforeach @endforeach