Skip to content

Commit 96263b6

Browse files
committed
Updating project methods to follow core conventions
1 parent 432c5d4 commit 96263b6

13 files changed

Lines changed: 31 additions & 30 deletions

public/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
require dirname(__DIR__) . '/vendor/autoload.php';
99

1010
use Quantum\App\Factories\AppFactory;
11-
use Quantum\App\App;
11+
use Quantum\App\Enums\AppType;
1212

1313
/*
1414
* -----------------------------------------------------------------------------
@@ -23,4 +23,4 @@
2323
* Starting the app
2424
* -----------------------------------------------------------------------------
2525
*/
26-
AppFactory::create(APP::WEB, dirname(__DIR__))->start();
26+
AppFactory::create(AppType::WEB, dirname(__DIR__))->start();

qt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
require __DIR__ . '/vendor/autoload.php';
99

1010
use Quantum\App\Factories\AppFactory;
11-
use Quantum\App\App;
11+
use Quantum\App\Enums\AppType;
1212

1313
/*
1414
* -----------------------------------------------------------------------------
@@ -23,6 +23,6 @@ if (!defined('DS')) define('DS', DIRECTORY_SEPARATOR);
2323
* Run the console application
2424
* ---------------------------------------------------------
2525
*/
26-
$status = AppFactory::create(APP::CONSOLE, __DIR__)->start();
26+
$status = AppFactory::create(AppType::CONSOLE, __DIR__)->start();
2727

2828
exit($status);

shared/Commands/CommandValidationTrait.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414

1515
namespace Shared\Commands;
1616

17+
use Quantum\Config\Exceptions\ConfigException;
18+
use Quantum\Lang\Exceptions\LangException;
19+
use Quantum\Di\Exceptions\DiException;
1720
use Quantum\Validation\Validator;
21+
use ReflectionException;
1822

1923
/**
2024
* Trait CommandValidationTrait
@@ -57,6 +61,11 @@ protected function validate(array $rules, array $data): bool
5761
* Gets the first validation error
5862
* @return string|null
5963
*/
64+
65+
/**
66+
* @return string|null
67+
* @throws ConfigException|DiException|LangException|ReflectionException
68+
*/
6069
public function firstError(): ?string
6170
{
6271
$errors = $this->validator->getErrors();

shared/Commands/CommentCreateCommand.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,9 @@ class CommentCreateCommand extends QtCommand
6161

6262
/**
6363
* Executes the command
64-
* @throws DiException
65-
* @throws ReflectionException
66-
* @throws ServiceException
67-
* @throws BaseException
64+
* @throws DiException|ServiceException|BaseException|ReflectionException
6865
*/
69-
public function exec()
66+
public function exec(): void
7067
{
7168
$this->initValidator();
7269

shared/Commands/CommentDeleteCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ class CommentDeleteCommand extends QtCommand
6868

6969
/**
7070
* Executes the command
71-
* @throws BaseException|DiException|ServiceException|ReflectionException
71+
* @throws DiException|ServiceException|BaseException|ReflectionException
7272
*/
73-
public function exec()
73+
public function exec(): void
7474
{
7575
$uuid = $this->getArgument('uuid');
7676

shared/Commands/DemoCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function __construct()
131131
* @throws ReflectionException
132132
* @throws ServiceException
133133
*/
134-
public function exec()
134+
public function exec(): void
135135
{
136136
if (!$this->getOption('yes')) {
137137
if (!$this->confirm('The operation will remove all previously created data and will create new dataset. Continue?')) {

shared/Commands/PostCreateCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ class PostCreateCommand extends QtCommand
6363

6464
/**
6565
* Executes the command
66-
* @throws BaseException|DiException|ServiceException|ReflectionException
66+
* @throws DiException|ServiceException|BaseException|ReflectionException
6767
*/
68-
public function exec()
68+
public function exec(): void
6969
{
7070
$this->initValidator();
7171

shared/Commands/PostDeleteCommand.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,9 @@ class PostDeleteCommand extends QtCommand
6969

7070
/**
7171
* Executes the command
72-
* @throws ReflectionException
73-
* @throws ServiceException
74-
* @throws DiException
72+
* @throws DiException|ServiceException|BaseException|ReflectionException
7573
*/
76-
public function exec()
74+
public function exec(): void
7775
{
7876
$uuid = $this->getArgument('uuid');
7977

shared/Commands/PostShowCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class PostShowCommand extends QtCommand
7070
* Executes the command
7171
* @throws BaseException|DiException|ServiceException|ReflectionException
7272
*/
73-
public function exec()
73+
public function exec(): void
7474
{
7575
$postService = service(PostService::class);
7676

shared/Commands/PostUpdateCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class PostUpdateCommand extends QtCommand
4747
* Command help text
4848
* @var string|null
4949
*/
50-
protected ?string $help = 'Use the following format to update the post:' . PHP_EOL . 'php qt post:update `[Post uuid]` -t `Title` -d `Description` [-i `Image`] [-a `Author`]';
50+
protected ?string $help = 'Use the following format to update the post:' . PHP_EOL . 'php qt post:update `[Post uuid]` -t `Title` -d `Description` [-i `Image`]';
5151

5252
/**
5353
* Command arguments
@@ -71,7 +71,7 @@ class PostUpdateCommand extends QtCommand
7171
* Executes the command
7272
* @throws BaseException|DiException|ServiceException|ReflectionException
7373
*/
74-
public function exec()
74+
public function exec(): void
7575
{
7676
$this->initValidator();
7777

0 commit comments

Comments
 (0)