Code styling update, no functional changes

This commit is contained in:
Deon George 2022-08-23 17:48:09 +10:00
parent e5f803d122
commit 4691a3f775
70 changed files with 101 additions and 101 deletions

View File

@ -5,6 +5,7 @@ namespace Slack;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Blockkit\Modal; use Slack\Blockkit\Modal;
use Slack\Response\Chat; use Slack\Response\Chat;
use Slack\Exceptions\{SlackAlreadyPinnedException, use Slack\Exceptions\{SlackAlreadyPinnedException,
@ -484,4 +485,4 @@ final class API
return $request; return $request;
} }
} }

View File

@ -2,14 +2,13 @@
namespace Slack; namespace Slack;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Models\{Channel,Enterprise,Team,User};
use App\Models\Slack\Channel as AppChannel; use App\Models\Slack\Channel as AppChannel;
use App\Models\Slack\Enterprise as AppEnterprise; use App\Models\Slack\Enterprise as AppEnterprise;
use App\Models\Slack\Team as AppTeam; use App\Models\Slack\Team as AppTeam;
use App\Models\Slack\User as AppUser; use App\Models\Slack\User as AppUser;
use Slack\Models\{Channel,Enterprise,Team,User};
/** /**
* Class Base - is a Base to all incoming Slack POST requests * Class Base - is a Base to all incoming Slack POST requests
@ -94,7 +93,6 @@ abstract class Base
} }
return $o->exists ? $o : NULL; return $o->exists ? $o : NULL;
} }
/** /**

View File

@ -5,8 +5,8 @@ namespace Slack\Blockkit\Blocks\Accessories;
use \Exception; use \Exception;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Slack\Blockkit\Blocks\Elements\Text; use Slack\Blockkit\Blocks\Elements\{Confirm,Text};
use Slack\Blockkit\Element; use Slack\Blockkit\Element;
final class Overflow extends Element final class Overflow extends Element
@ -19,7 +19,6 @@ final class Overflow extends Element
private const MAX_OPTIONS = 5; private const MAX_OPTIONS = 5;
/** /**
* @param Text $placeholder
* @param string $action_id * @param string $action_id
* @param Collection $options * @param Collection $options
* @throws Exception * @throws Exception

View File

@ -4,9 +4,9 @@ namespace Slack\Blockkit\Blocks;
use \Exception; use \Exception;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Slack\Blockkit\Blocks; use Slack\Blockkit\Blocks;
use Slack\Blockkit\Blocks\Elements\{Button,MultiStaticSelect,Text}; use Slack\Blockkit\Blocks\Elements\{Button,MultiStaticSelect};
use Slack\Blockkit\Element;
final class Actions extends Blocks final class Actions extends Blocks
{ {
@ -22,10 +22,6 @@ final class Actions extends Blocks
Blocks\Accessories\Overflow::class, Blocks\Accessories\Overflow::class,
]; ];
/**
* @param Text $text
* @throws Exception
*/
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();

View File

@ -4,6 +4,7 @@ namespace Slack\Blockkit\Blocks;
use \Exception; use \Exception;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Slack\Blockkit\Blocks; use Slack\Blockkit\Blocks;
final class Context extends Blocks final class Context extends Blocks

View File

@ -2,9 +2,7 @@
namespace Slack\Blockkit\Blocks; namespace Slack\Blockkit\Blocks;
use \Exception;
use Slack\Blockkit\Blocks; use Slack\Blockkit\Blocks;
use Slack\Blockkit\Blocks\Elements\Text;
final class Divider extends Blocks final class Divider extends Blocks
{ {
@ -12,10 +10,6 @@ final class Divider extends Blocks
'block_id' => 255, // @todo Should be unique for each message 'block_id' => 255, // @todo Should be unique for each message
]; ];
/**
* @param Text|NULL $text
* @throws Exception
*/
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();

View File

@ -3,6 +3,7 @@
namespace Slack\Blockkit\Blocks\Elements; namespace Slack\Blockkit\Blocks\Elements;
use \Exception; use \Exception;
use Slack\Blockkit\Element; use Slack\Blockkit\Element;
final class Button extends Element final class Button extends Element

View File

@ -2,13 +2,14 @@
namespace Slack\Blockkit\Blocks\Elements; namespace Slack\Blockkit\Blocks\Elements;
use \Exception;
use Slack\Blockkit\Element; use Slack\Blockkit\Element;
final class Confirm extends Element final class Confirm extends Element
{ {
public function __construct() public function __construct()
{ {
parent::__construct();
abort(500,'Not Implememted'); abort(500,'Not Implememted');
} }

View File

@ -3,6 +3,7 @@
namespace Slack\Blockkit\Blocks\Elements; namespace Slack\Blockkit\Blocks\Elements;
use \Exception; use \Exception;
use Slack\Blockkit\Element; use Slack\Blockkit\Element;
/** /**

View File

@ -3,6 +3,7 @@
namespace Slack\Blockkit\Blocks\Elements; namespace Slack\Blockkit\Blocks\Elements;
use \Exception; use \Exception;
use Slack\Blockkit\Element; use Slack\Blockkit\Element;
final class Text extends Element final class Text extends Element

View File

@ -3,6 +3,7 @@
namespace Slack\Blockkit\Blocks; namespace Slack\Blockkit\Blocks;
use \Exception; use \Exception;
use Slack\Blockkit\Blocks; use Slack\Blockkit\Blocks;
use Slack\Blockkit\Blocks\Elements\Text; use Slack\Blockkit\Blocks\Elements\Text;

View File

@ -3,7 +3,7 @@
namespace Slack\Blockkit\Blocks; namespace Slack\Blockkit\Blocks;
use \Exception; use \Exception;
use Illuminate\Support\Collection;
use Slack\Blockkit\{Blocks,Element}; use Slack\Blockkit\{Blocks,Element};
final class Input extends Blocks final class Input extends Blocks
@ -22,7 +22,7 @@ final class Input extends Blocks
// @todo dispatch_action // @todo dispatch_action
/** /**
* @param Text|NULL $text not required if fields is provided * @param Elements\Text|null $label
* @throws Exception * @throws Exception
*/ */
public function __construct(Elements\Text $label=NULL) public function __construct(Elements\Text $label=NULL)

View File

@ -4,6 +4,7 @@ namespace Slack\Blockkit\Blocks;
use \Exception; use \Exception;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Slack\Blockkit\{Blocks,Element}; use Slack\Blockkit\{Blocks,Element};
use Slack\BLockKit\Blocks\Elements\Text; use Slack\BLockKit\Blocks\Elements\Text;

View File

@ -3,6 +3,7 @@
namespace Slack\Blockkit; namespace Slack\Blockkit;
use \Exception; use \Exception;
use Slack\BlockKit; use Slack\BlockKit;
use Slack\Blockkit\Blocks\Divider; use Slack\Blockkit\Blocks\Divider;
use Slack\Blockkit\Blocks\Elements\Text; use Slack\Blockkit\Blocks\Elements\Text;

View File

@ -2,9 +2,8 @@
namespace Slack\Channels; namespace Slack\Channels;
use Illuminate\Notifications\Notification; use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
class SlackBotChannel class SlackBotChannel
{ {

View File

@ -3,8 +3,8 @@
namespace Slack\Command; namespace Slack\Command;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Base as SlackBase; use Slack\Base as SlackBase;
use Slack\Blockkit\Blocks;
use Slack\Message; use Slack\Message;
abstract class Base extends SlackBase abstract class Base extends SlackBase

View File

@ -5,6 +5,7 @@ namespace Slack\Command;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Client\Payload; use Slack\Client\Payload;
class Factory { class Factory {

View File

@ -2,8 +2,8 @@
namespace Slack\Command; namespace Slack\Command;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Message; use Slack\Message;
/** /**

View File

@ -5,6 +5,7 @@ namespace Slack\Console\Commands;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use React\EventLoop\Loop; use React\EventLoop\Loop;
use Slack\Client\SocketMode; use Slack\Client\SocketMode;
use Slack\Command\Factory as SlackCommandFactory; use Slack\Command\Factory as SlackCommandFactory;
use Slack\Event\Factory as SlackEventFactory; use Slack\Event\Factory as SlackEventFactory;
@ -63,4 +64,4 @@ class SlackSocketClient extends Command
$loop->run(); $loop->run();
} }
} }

View File

@ -2,8 +2,8 @@
namespace Slack\Event; namespace Slack\Event;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Base as SlackBase; use Slack\Base as SlackBase;
abstract class Base extends SlackBase abstract class Base extends SlackBase

View File

@ -2,10 +2,10 @@
namespace Slack\Event; namespace Slack\Event;
use Illuminate\Http\Request;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Client\Payload; use Slack\Client\Payload;
class Factory { class Factory {

View File

@ -2,7 +2,6 @@
namespace Slack\Event; namespace Slack\Event;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
/** /**

View File

@ -4,10 +4,10 @@ namespace Slack\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Client\Payload;
use Slack\Event\Factory as SlackEventFactory;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Slack\Client\Payload;
use Slack\Event\Factory as SlackEventFactory;
class EventsController extends Controller class EventsController extends Controller
{ {
@ -27,4 +27,4 @@ class EventsController extends Controller
return response('Event Processed',200); return response('Event Processed',200);
} }
} }

View File

@ -4,12 +4,12 @@ namespace Slack\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use App\Http\Controllers\Controller;
use Slack\Client\Payload; use Slack\Client\Payload;
use Slack\Message; use Slack\Message;
use Slack\Interactive\Factory as InteractiveMessageFactory; use Slack\Interactive\Factory as InteractiveMessageFactory;
use App\Http\Controllers\Controller;
class InteractiveMessageController extends Controller class InteractiveMessageController extends Controller
{ {
private const LOGKEY = 'CIM'; private const LOGKEY = 'CIM';

View File

@ -4,10 +4,10 @@ namespace Slack\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Client\Payload;
use Slack\Options\Factory as SlackOptionsFactory;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Slack\Client\Payload;
use Slack\Options\Factory as SlackOptionsFactory;
class InteractiveOptionsController extends Controller class InteractiveOptionsController extends Controller
{ {
@ -18,6 +18,7 @@ class InteractiveOptionsController extends Controller
* *
* @param Request $request * @param Request $request
* @return \Illuminate\Http\Response|\Laravel\Lumen\Http\ResponseFactory * @return \Illuminate\Http\Response|\Laravel\Lumen\Http\ResponseFactory
* @throws \Exception
*/ */
public function fire(Request $request) public function fire(Request $request)
{ {

View File

@ -11,7 +11,6 @@ use Slack\Jobs\TeamUpdate;
use Slack\Models\{Enterprise,Team,Token,User}; use Slack\Models\{Enterprise,Team,Token,User};
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\Slack\Channel as AppChannel;
use App\Models\Slack\Enterprise as AppEnterprise; use App\Models\Slack\Enterprise as AppEnterprise;
use App\Models\Slack\Team as AppTeam; use App\Models\Slack\Team as AppTeam;
use App\Models\Slack\User as AppUser; use App\Models\Slack\User as AppUser;
@ -177,4 +176,4 @@ class SlackAppController extends Controller
'user_scope' => join(',',config('slack.user_scopes')), 'user_scope' => join(',',config('slack.user_scopes')),
]; ];
} }
} }

View File

@ -7,7 +7,6 @@ use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Slack\Client\Payload; use Slack\Client\Payload;
use Slack\Command\Factory; use Slack\Command\Factory;
use Slack\Message; use Slack\Message;

View File

@ -5,6 +5,7 @@ namespace Slack\Http\Middleware;
use Closure; use Closure;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Client\Payload; use Slack\Client\Payload;
use Slack\Event\Factory as EventFactory; use Slack\Event\Factory as EventFactory;
use Slack\Interactive\Factory as InteractiveFactory; use Slack\Interactive\Factory as InteractiveFactory;

View File

@ -6,6 +6,7 @@ use Carbon\Carbon;
use Closure; use Closure;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Base; use Slack\Base;
class CheckSignature class CheckSignature

View File

@ -3,6 +3,7 @@
namespace Slack\Interactive; namespace Slack\Interactive;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Base as SlackBase; use Slack\Base as SlackBase;
abstract class Base extends SlackBase abstract class Base extends SlackBase

View File

@ -4,6 +4,7 @@ namespace Slack\Interactive;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Slack\Models\Channel; use Slack\Models\Channel;
/** /**

View File

@ -4,6 +4,7 @@ namespace Slack\Interactive;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Message; use Slack\Message;
/** /**
@ -120,4 +121,4 @@ class InteractiveMessage extends Base
return (new Message)->text('That didnt work, I didnt know what to do with your button - you might like to tell '.$this->team()->owner->slack_user); return (new Message)->text('That didnt work, I didnt know what to do with your button - you might like to tell '.$this->team()->owner->slack_user);
} }
} }
} }

View File

@ -35,4 +35,4 @@ class Shortcut extends Base
return parent::__get($key); return parent::__get($key);
} }
} }
} }

View File

@ -2,7 +2,6 @@
namespace Slack\Interactive; namespace Slack\Interactive;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
/** /**
@ -18,4 +17,4 @@ class Unknown extends Base
parent::__construct($request); parent::__construct($request);
} }
} }

View File

@ -84,4 +84,4 @@ class ViewClosed extends Base
return parent::__get($key); return parent::__get($key);
} }
} }
} }

View File

@ -5,9 +5,9 @@ namespace Slack\Interactive;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Message;
use Slack\Models\Team;
use Slack\Blockkit\Modal; use Slack\Blockkit\Modal;
use Slack\Models\Team;
/** /**
* Incoming modal view submission event. * Incoming modal view submission event.
@ -41,7 +41,8 @@ class ViewSubmission extends Base
/** /**
* This method should be overridden by a local implementation * This method should be overridden by a local implementation
* *
* @return Message * @return Modal
* @throws \Exception
*/ */
public function respond(): Modal public function respond(): Modal
{ {
@ -96,4 +97,4 @@ class ViewSubmission extends Base
// Return the state value, or the original block value // Return the state value, or the original block value
return object_get($this->_data,'view.state.values.'.$key.'.'.$block_id.'.value') ?: object_get(Arr::get(object_get($this->_data,'view.blocks'),$key),'text.text',''); return object_get($this->_data,'view.state.values.'.$key.'.'.$block_id.'.value') ?: object_get(Arr::get(object_get($this->_data,'view.blocks'),$key),'text.text','');
} }
} }

View File

@ -4,6 +4,7 @@ namespace Slack\Jobs;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Models\{Channel,User}; use Slack\Models\{Channel,User};
use Slack\Exceptions\SlackException; use Slack\Exceptions\SlackException;
@ -52,4 +53,4 @@ class DeleteChat extends Job
Log::error(sprintf('%s:Failed to delete slack message [%s] [%s]',static::LOGKEY,$this->ts,$e->getMessage()),['m'=>__METHOD__]); Log::error(sprintf('%s:Failed to delete slack message [%s] [%s]',static::LOGKEY,$this->ts,$e->getMessage()),['m'=>__METHOD__]);
} }
} }
} }

View File

@ -29,4 +29,4 @@ abstract class Job implements ShouldQueue
{ {
return Arr::get($this->_data,$key); return Arr::get($this->_data,$key);
} }
} }

View File

@ -3,6 +3,7 @@
namespace Slack\Jobs; namespace Slack\Jobs;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Exceptions\SlackTokenScopeException; use Slack\Exceptions\SlackTokenScopeException;
use Slack\Models\Team; use Slack\Models\Team;
@ -44,4 +45,4 @@ class TeamUpdate extends Job
$this->to->save(); $this->to->save();
} }
} }

View File

@ -4,9 +4,9 @@ namespace Slack\Listeners;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Queue\ShouldQueue;
use Slack\Event\AppHomeOpened;
use App\Jobs\SlackHomeTabUpdate; use App\Jobs\SlackHomeTabUpdate;
use Slack\Event\AppHomeOpened;
class AppHomeOpenedListener implements ShouldQueue class AppHomeOpenedListener implements ShouldQueue
{ {
@ -27,4 +27,4 @@ class AppHomeOpenedListener implements ShouldQueue
dispatch((new SlackHomeTabUpdate($event->user(),$event->team(TRUE),$event->tab,$event->view))->onQueue('high')); dispatch((new SlackHomeTabUpdate($event->user(),$event->team(TRUE),$event->tab,$event->view))->onQueue('high'));
} }
} }

View File

@ -3,6 +3,7 @@
namespace Slack\Listeners; namespace Slack\Listeners;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Jobs\DeleteChat; use Slack\Jobs\DeleteChat;
use Slack\Interactive\BlockActions; use Slack\Interactive\BlockActions;
@ -82,4 +83,4 @@ class BlockActionListener
} }
} }
} }
} }

View File

@ -35,4 +35,4 @@ class ChannelJoinListener implements ShouldQueue
Log::debug(sprintf('%s:Wasnt the BOT who joined Channel [%s]',self::LOGKEY,$event->channel_id),['m'=>__METHOD__]); Log::debug(sprintf('%s:Wasnt the BOT who joined Channel [%s]',self::LOGKEY,$event->channel_id),['m'=>__METHOD__]);
} }
} }
} }

View File

@ -31,4 +31,4 @@ class ChannelLeftListener implements ShouldQueue
$o->active = FALSE; $o->active = FALSE;
$o->save(); $o->save();
} }
} }

View File

@ -29,4 +29,4 @@ class InteractiveMessageListener implements ShouldQueue
Log::notice(sprintf('%s:Unhandled CALLBACK [%s]',self::LOGKEY,$event->callback_id),['m'=>__METHOD__]); Log::notice(sprintf('%s:Unhandled CALLBACK [%s]',self::LOGKEY,$event->callback_id),['m'=>__METHOD__]);
} }
} }
} }

View File

@ -35,4 +35,4 @@ class MessageListener implements ShouldQueue
Log::notice(sprintf('%s:Unhandled TYPE [%s]',self::LOGKEY,$event->type),['m'=>__METHOD__]); Log::notice(sprintf('%s:Unhandled TYPE [%s]',self::LOGKEY,$event->type),['m'=>__METHOD__]);
} }
} }
} }

View File

@ -26,4 +26,4 @@ class PinAddedListener implements ShouldQueue
Log::notice(sprintf('%s:Ignoring Pin Add on [%s]',static::LOGKEY,$event->ts),['m'=>__METHOD__]); Log::notice(sprintf('%s:Ignoring Pin Add on [%s]',static::LOGKEY,$event->ts),['m'=>__METHOD__]);
} }
} }

View File

@ -26,4 +26,4 @@ class PinRemovedListener implements ShouldQueue
Log::debug(sprintf('%s:Ignoring Pin Remove on [%s]',static::LOGKEY,$event->ts),['m'=>__METHOD__]); Log::debug(sprintf('%s:Ignoring Pin Remove on [%s]',static::LOGKEY,$event->ts),['m'=>__METHOD__]);
} }
} }

View File

@ -26,4 +26,4 @@ class ReactionAddedListener implements ShouldQueue
Log::debug(sprintf('%s:Ignoring Reaction Add [%s] on [%s]',static::LOGKEY,$event->reaction,$event->ts),['m'=>__METHOD__]); Log::debug(sprintf('%s:Ignoring Reaction Add [%s] on [%s]',static::LOGKEY,$event->reaction,$event->ts),['m'=>__METHOD__]);
} }
} }

View File

@ -1,8 +1,9 @@
<?php <?php
namespace App\Listeners; namespace Slack\Listeners;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Blockkit\Blocks\Elements\Text; use Slack\Blockkit\Blocks\Elements\Text;
use Slack\Blockkit\Blocks\{Header,Section}; use Slack\Blockkit\Blocks\{Header,Section};
use Slack\Blockkit\Modal; use Slack\Blockkit\Modal;
@ -20,10 +21,11 @@ class ShortcutListener //implements ShouldQueue
* Handle the event. * Handle the event.
* *
* @param Shortcut $event * @param Shortcut $event
* @return void * @return Message|null
* @throws \Exception
* @todo To Test * @todo To Test
*/ */
public function handle(Shortcut $event): Message public function handle(Shortcut $event): ?Message
{ {
if (! $event->channel() || ! $event->channel()->active) { if (! $event->channel() || ! $event->channel()->active) {
$modal = new Modal(Text::item(config('app.name'),'plain_text')); $modal = new Modal(Text::item(config('app.name'),'plain_text'));
@ -53,4 +55,4 @@ class ShortcutListener //implements ShouldQueue
Log::notice(sprintf('%s:Unhandled CALLBACK [%s]',self::LOGKEY,$event->callback_id),['m'=>__METHOD__]); Log::notice(sprintf('%s:Unhandled CALLBACK [%s]',self::LOGKEY,$event->callback_id),['m'=>__METHOD__]);
} }
} }
} }

View File

@ -29,4 +29,4 @@ class ViewClosedListener implements ShouldQueue
Log::notice(sprintf('%s:Unhandled CALLBACK [%s]',self::LOGKEY,$event->callback_id),['m'=>__METHOD__]); Log::notice(sprintf('%s:Unhandled CALLBACK [%s]',self::LOGKEY,$event->callback_id),['m'=>__METHOD__]);
} }
} }
} }

View File

@ -29,4 +29,4 @@ class ViewSubmissionListener implements ShouldQueue
Log::notice(sprintf('%s:Unhandled CALLBACK [%s]',self::LOGKEY,$event->callback_id),['m'=>__METHOD__]); Log::notice(sprintf('%s:Unhandled CALLBACK [%s]',self::LOGKEY,$event->callback_id),['m'=>__METHOD__]);
} }
} }
} }

View File

@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Blockkit\Blocks; use Slack\Blockkit\Blocks;
use Slack\Blockkit\Blocks\Context; use Slack\Blockkit\Blocks\Context;
use Slack\Blockkit\Blocks\Elements\Text; use Slack\Blockkit\Blocks\Elements\Text;

View File

@ -4,6 +4,7 @@ namespace Slack\Message;
use \Exception; use \Exception;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Slack\BlockKit; use Slack\BlockKit;
use Slack\Blockkit\Blocks; use Slack\Blockkit\Blocks;
@ -13,15 +14,6 @@ final class Attachment extends BlockKit
'footer' => 300, 'footer' => 300,
]; ];
/**
* @param Text $text
* @throws Exception
*/
public function __construct()
{
parent::__construct();
}
public static function item(): self public static function item(): self
{ {
return new self(); return new self();

View File

@ -2,10 +2,10 @@
namespace Slack\Models; namespace Slack\Models;
use App\Models\Slack\Team as AppTeam;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use App\Models\Slack\Team as AppTeam;
use Slack\Traits\ScopeActive; use Slack\Traits\ScopeActive;
class Channel extends Model class Channel extends Model

View File

@ -2,9 +2,9 @@
namespace Slack\Models; namespace Slack\Models;
use App\Models\Slack\Team as AppTeam;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use App\Models\Slack\Team as AppTeam;
use Slack\Traits\ScopeActive; use Slack\Traits\ScopeActive;
class Enterprise extends Model class Enterprise extends Model

View File

@ -2,11 +2,11 @@
namespace Slack\Models; namespace Slack\Models;
use Illuminate\Database\Eloquent\Model;
use App\Models\Slack\Channel as AppChannel; use App\Models\Slack\Channel as AppChannel;
use App\Models\Slack\Token as AppToken; use App\Models\Slack\Token as AppToken;
use App\Models\Slack\User as AppUser; use App\Models\Slack\User as AppUser;
use Illuminate\Database\Eloquent\Model;
use Slack\API; use Slack\API;
use Slack\Traits\ScopeActive; use Slack\Traits\ScopeActive;

View File

@ -2,10 +2,10 @@
namespace Slack\Models; namespace Slack\Models;
use App\Models\Slack\Team as AppTeam;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use App\Models\Slack\Team as AppTeam;
use Slack\Traits\ScopeActive; use Slack\Traits\ScopeActive;
class Token extends Model class Token extends Model

View File

@ -2,12 +2,12 @@
namespace Slack\Models; namespace Slack\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Log;
use App\Models\Slack\Channel; use App\Models\Slack\Channel;
use App\Models\Slack\Enterprise as AppEnterprise; use App\Models\Slack\Enterprise as AppEnterprise;
use App\Models\Slack\Team as AppTeam; use App\Models\Slack\Team as AppTeam;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Log;
use Slack\Traits\ScopeActive; use Slack\Traits\ScopeActive;
class User extends Model class User extends Model

View File

@ -3,6 +3,7 @@
namespace Slack\Options; namespace Slack\Options;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Message; use Slack\Message;
/** /**

View File

@ -2,7 +2,6 @@
namespace Slack\Options; namespace Slack\Options;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
/** /**
@ -12,10 +11,10 @@ use Illuminate\Support\Facades\Log;
*/ */
class Unknown extends Base class Unknown extends Base
{ {
public function __construct(Request $request) public function __construct(array $request)
{ {
Log::notice(sprintf('SOU:UNKNOWN Slack Interaction Option received [%s]',get_class($this)),['m'=>__METHOD__]); Log::notice(sprintf('SOU:UNKNOWN Slack Interaction Option received [%s]',get_class($this)),['m'=>__METHOD__]);
parent::__construct($request); parent::__construct($request);
} }
} }

View File

@ -5,6 +5,7 @@ namespace Slack\Providers;
use Illuminate\Notifications\ChannelManager; use Illuminate\Notifications\ChannelManager;
use Illuminate\Support\Facades\Notification; use Illuminate\Support\Facades\Notification;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Slack\API; use Slack\API;
use Slack\Channels\SlackBotChannel; use Slack\Channels\SlackBotChannel;
use Slack\Console\Commands\SlackSocketClient; use Slack\Console\Commands\SlackSocketClient;

View File

@ -4,6 +4,7 @@ namespace Slack\Response;
use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Slack\Base as SlackBase; use Slack\Base as SlackBase;
/** /**
@ -67,6 +68,6 @@ class Base extends SlackBase implements \JsonSerializable
*/ */
public function jsonSerialize() public function jsonSerialize()
{ {
return $this->_data ? $this->_data : new \stdClass; return $this->_data ?: new \stdClass;
} }
} }

View File

@ -20,4 +20,4 @@ final class ChannelList extends Base
return object_get($this->_data,$key); return object_get($this->_data,$key);
} }
} }
} }

View File

@ -46,4 +46,4 @@ class Chat extends Base
{ {
return $this->messages->first()->reply_users_count; return $this->messages->first()->reply_users_count;
} }
} }

View File

@ -24,4 +24,4 @@ class Generic extends Base
return parent::__get($key); return parent::__get($key);
} }
} }
} }

View File

@ -27,4 +27,4 @@ final class Team extends Base
return object_get($this->_data,'team.'.$key); return object_get($this->_data,'team.'.$key);
} }
} }
} }

View File

@ -28,4 +28,4 @@ class Test extends Base
return parent::__get($key); return parent::__get($key);
} }
} }
} }

View File

@ -32,4 +32,4 @@ final class User extends Base
return object_get($this->_data,'user.id'); return object_get($this->_data,'user.id');
} }
} }
} }

View File

@ -14,4 +14,4 @@ trait ScopeActive
{ {
return $query->where($this->getTable().'.active',TRUE); return $query->where($this->getTable().'.active',TRUE);
} }
} }

View File

@ -43,4 +43,4 @@ app('router')
'uses' => 'SlashCommandController@fire', 'uses' => 'SlashCommandController@fire',
'as' => 'slashcommand', 'as' => 'slashcommand',
]); ]);
}); });