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\Facades\App;
use Illuminate\Support\Facades\Log;
use Slack\Blockkit\Modal;
use Slack\Response\Chat;
use Slack\Exceptions\{SlackAlreadyPinnedException,

View File

@ -2,14 +2,13 @@
namespace Slack;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Slack\Models\{Channel,Enterprise,Team,User};
use App\Models\Slack\Channel as AppChannel;
use App\Models\Slack\Enterprise as AppEnterprise;
use App\Models\Slack\Team as AppTeam;
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
@ -94,7 +93,6 @@ abstract class Base
}
return $o->exists ? $o : NULL;
}
/**

View File

@ -5,8 +5,8 @@ namespace Slack\Blockkit\Blocks\Accessories;
use \Exception;
use Illuminate\Support\Arr;
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;
final class Overflow extends Element
@ -19,7 +19,6 @@ final class Overflow extends Element
private const MAX_OPTIONS = 5;
/**
* @param Text $placeholder
* @param string $action_id
* @param Collection $options
* @throws Exception

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,6 +5,7 @@ namespace Slack\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
use React\EventLoop\Loop;
use Slack\Client\SocketMode;
use Slack\Command\Factory as SlackCommandFactory;
use Slack\Event\Factory as SlackEventFactory;

View File

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

View File

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

View File

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

View File

@ -4,10 +4,10 @@ namespace Slack\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Slack\Client\Payload;
use Slack\Event\Factory as SlackEventFactory;
use App\Http\Controllers\Controller;
use Slack\Client\Payload;
use Slack\Event\Factory as SlackEventFactory;
class EventsController extends Controller
{

View File

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

View File

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

View File

@ -11,7 +11,6 @@ use Slack\Jobs\TeamUpdate;
use Slack\Models\{Enterprise,Team,Token,User};
use App\Http\Controllers\Controller;
use App\Models\Slack\Channel as AppChannel;
use App\Models\Slack\Enterprise as AppEnterprise;
use App\Models\Slack\Team as AppTeam;
use App\Models\Slack\User as AppUser;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,6 +4,7 @@ namespace Slack\Interactive;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Log;
use Slack\Message;
/**

View File

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

View File

@ -5,9 +5,9 @@ namespace Slack\Interactive;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Slack\Message;
use Slack\Models\Team;
use Slack\Blockkit\Modal;
use Slack\Models\Team;
/**
* Incoming modal view submission event.
@ -41,7 +41,8 @@ class ViewSubmission extends Base
/**
* This method should be overridden by a local implementation
*
* @return Message
* @return Modal
* @throws \Exception
*/
public function respond(): Modal
{

View File

@ -4,6 +4,7 @@ namespace Slack\Jobs;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Log;
use Slack\Models\{Channel,User};
use Slack\Exceptions\SlackException;

View File

@ -3,6 +3,7 @@
namespace Slack\Jobs;
use Illuminate\Support\Facades\Log;
use Slack\Exceptions\SlackTokenScopeException;
use Slack\Models\Team;

View File

@ -4,9 +4,9 @@ namespace Slack\Listeners;
use Illuminate\Support\Facades\Log;
use Illuminate\Contracts\Queue\ShouldQueue;
use Slack\Event\AppHomeOpened;
use App\Jobs\SlackHomeTabUpdate;
use Slack\Event\AppHomeOpened;
class AppHomeOpenedListener implements ShouldQueue
{

View File

@ -3,6 +3,7 @@
namespace Slack\Listeners;
use Illuminate\Support\Facades\Log;
use Slack\Jobs\DeleteChat;
use Slack\Interactive\BlockActions;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,6 @@
namespace Slack\Options;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
/**
@ -12,7 +11,7 @@ use Illuminate\Support\Facades\Log;
*/
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__]);

View File

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

View File

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