Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '7.3', '7.4' ]
php-versions: ['7.4', '8.0', '8.1' ]

runs-on: ${{ matrix.operating-system }}

Expand All @@ -35,12 +35,12 @@ jobs:
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-
${{ runner.os }}-php-${{ matrix.php-versions }}-

- name: Install dependencies
run: composer install --prefer-dist --no-progress
run: composer update --prefer-dist --no-progress

- name: Create env
run: php qt core:env
Expand Down
6 changes: 1 addition & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
"license": "MIT",
"type": "project",
"require": {
"quantum/framework": "^2.9.9",
"quantum/framework": "dev-master",
"fakerphp/faker": "^1.15",
"bluemmb/faker-picsum-photos-provider": "^2.0",
"ottaviano/faker-gravatar": "^0.3.0",
"doctrine/annotations": "^2.0",
"voku/html-min": "^4.5",
"league/commonmark": "^1.6",
"ezyang/htmlpurifier": "^4.18",
"symfony/process": "^5.4"
},
"require-dev": {
Expand Down
11 changes: 5 additions & 6 deletions helpers/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
* @since 2.9.9
*/

use Quantum\Libraries\HttpClient\Exceptions\HttpClientException;
use Quantum\Libraries\Storage\Factories\FileSystemFactory;
use Quantum\HttpClient\Exceptions\HttpClientException;
use Quantum\Storage\Factories\FileSystemFactory;
use Quantum\Config\Exceptions\ConfigException;
use Quantum\Libraries\HttpClient\HttpClient;
use Quantum\App\Exceptions\BaseException;
use Quantum\Di\Exceptions\DiException;
use Quantum\Http\Request;
use Quantum\HttpClient\HttpClient;

/**
* Gets the url with selected language
* Gets the url with the selected language
* @param string $lang
* @return string
*/
Expand Down Expand Up @@ -132,7 +131,7 @@ function nav_ref_encode(?string $query): string
/**
* Decodes a URL-safe base64 reference back to query string.
*
* @param string $ref
* @param string|null $ref
* @return string
*/
function nav_ref_decode(?string $ref): string
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion migrations/create_table_comments_1698145440.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

use Quantum\Libraries\Database\Factories\TableFactory;
use Quantum\Database\Factories\TableFactory;
use Quantum\Migration\QtMigration;

class Create_table_comments_1698145440 extends QtMigration
Expand Down
2 changes: 1 addition & 1 deletion migrations/create_table_posts_1669639752.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

use Quantum\Libraries\Database\Factories\TableFactory;
use Quantum\Database\Factories\TableFactory;
use Quantum\Migration\QtMigration;

class Create_table_posts_1669639752 extends QtMigration
Expand Down
2 changes: 1 addition & 1 deletion migrations/create_table_users_1669639740.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

use Quantum\Libraries\Database\Factories\TableFactory;
use Quantum\Database\Factories\TableFactory;
use Quantum\Migration\QtMigration;

class Create_table_users_1669639740 extends QtMigration
Expand Down
6 changes: 3 additions & 3 deletions shared/Commands/CommandValidationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
* @author Arman Ag. <arman.ag@softberg.org>
* @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
* @link http://quantum.softberg.org/
* @since 2.9.9
* @since 3.0.0
*/

namespace Shared\Commands;

use Quantum\Libraries\Validation\Validator;
use Quantum\Validation\Validator;

/**
* Trait CommandValidationTrait
Expand All @@ -26,7 +26,7 @@ trait CommandValidationTrait
/**
* @var Validator
*/
protected $validator;
protected Validator $validator;

/**
* Initiates the validator
Expand Down
18 changes: 9 additions & 9 deletions shared/Commands/CommentCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
* @author Arman Ag. <arman.ag@softberg.org>
* @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
* @link http://quantum.softberg.org/
* @since 2.9.9
* @since 3.0.0
*/

namespace Shared\Commands;

use Quantum\Service\Exceptions\ServiceException;
use Quantum\App\Exceptions\BaseException;
use Quantum\Libraries\Validation\Rule;
use Quantum\Di\Exceptions\DiException;
use Shared\Services\CommentService;
use Quantum\Console\QtCommand;
use Quantum\Validation\Rule;
use ReflectionException;

/**
Expand All @@ -33,27 +33,27 @@ class CommentCreateCommand extends QtCommand

/**
* Command name
* @var string
* @var string|null
*/
protected $name = 'comment:create';
protected ?string $name = 'comment:create';

/**
* Command description
* @var string
* @var string|null
*/
protected $description = 'Allows to create a comment record';
protected ?string $description = 'Allows to create a comment record';

/**
* Command help text
* @var string
* @var string|null
*/
protected $help = 'Use the following format to create a comment record:' . PHP_EOL . 'php qt comment:create `Post UUID` `User UUID` `Content`';
protected ?string $help = 'Use the following format to create a comment record:' . PHP_EOL . 'php qt comment:create `Post UUID` `User UUID` `Content`';

/**
* Command arguments
* @var array[]
*/
protected $args = [
protected array $args = [
['post_uuid', 'required', 'The post uuid the comment belongs to'],
['user_uuid', 'required', 'The user uuid who writes the comment'],
['content', 'required', 'Comment text'],
Expand Down
23 changes: 10 additions & 13 deletions shared/Commands/CommentDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author Arman Ag. <arman.ag@softberg.org>
* @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
* @link http://quantum.softberg.org/
* @since 2.9.9
* @since 3.0.0
*/

namespace Shared\Commands;
Expand All @@ -29,21 +29,21 @@ class CommentDeleteCommand extends QtCommand
{
/**
* Command name
* @var string
* @var string|null
*/
protected $name = 'comment:delete';
protected ?string $name = 'comment:delete';

/**
* Command description
* @var string
* @var string|null
*/
protected $description = 'Deletes a comment by UUID or clears the entire comments table with confirmation';
protected ?string $description = 'Deletes a comment by UUID or clears the entire comments table with confirmation';

/**
* Command help text
* @var string
* @var string|null
*/
protected $help = <<<HELP
protected ?string $help = <<<HELP
Usage:
- Delete a specific comment: php qt comment:delete `{comment_uuid}`
- Delete all comments (with confirmation): php qt comment:delete
Expand All @@ -54,24 +54,21 @@ class CommentDeleteCommand extends QtCommand
* Command arguments
* @var array[]
*/
protected $args = [
protected array $args = [
['uuid', 'optional', 'Comment uuid'],
];

/**
* Command options
* @var array[]
*/
protected $options = [
protected array $options = [
['yes', 'y', 'none', 'Skip confirmation and delete all comments'],
];

/**
* Executes the command
* @throws BaseException
* @throws DiException
* @throws ReflectionException
* @throws ServiceException
* @throws BaseException|DiException|ServiceException|ReflectionException
*/
public function exec()
{
Expand Down
38 changes: 19 additions & 19 deletions shared/Commands/DemoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@
* @author Arman Ag. <arman.ag@softberg.org>
* @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
* @link http://quantum.softberg.org/
* @since 2.9.9
* @since 3.0.0
*/

namespace Shared\Commands;

use Quantum\Libraries\HttpClient\Exceptions\HttpClientException;
use Symfony\Component\Console\Exception\ExceptionInterface;
use Quantum\Libraries\Storage\Factories\FileSystemFactory;
use Quantum\HttpClient\Exceptions\HttpClientException;
use Symfony\Component\Console\Helper\ProgressBar;
use Quantum\Storage\Factories\FileSystemFactory;
use Quantum\Service\Exceptions\ServiceException;
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Input\ArrayInput;
use Quantum\Config\Exceptions\ConfigException;
use Quantum\App\Exceptions\BaseException;
use Quantum\Libraries\Database\Database;
use Bluemmb\Faker\PicsumPhotosProvider;
use Quantum\Di\Exceptions\DiException;
use Symfony\Component\Process\Process;
use Quantum\Database\Database;
use Quantum\Console\QtCommand;
use Ottaviano\Faker\Gravatar;
use ReflectionException;
Expand All @@ -42,51 +42,51 @@
class DemoCommand extends QtCommand
{

/**
* Default password for generated users
*/
const DEFAULT_PASSWORD = 'password';

/**
* Command name
* @var string
* @var string|null
*/
protected $name = 'install:demo';
protected ?string $name = 'install:demo';

/**
* Command description
* @var string
* @var string|null
*/
protected $description = 'Generates demo users and posts';
protected ?string $description = 'Generates demo users and posts';

/**
* Command help text
* @var string
* @var string|null
*/
protected $help = 'The command will create demo users and posts for your project';
protected ?string $help = 'The command will create demo users and posts for your project';

/**
* The default action for all confirmations
* @var array
*/
protected $options = [
protected array $options = [
['yes', 'y', 'none', 'Acceptance of the confirmations']
];

/**
* @var Generator
*/
protected $faker;
protected Generator $faker;

/**
* @var array
*/
private $generatedUsers = [];
private array $generatedUsers = [];

/**
* @var array
*/
private $generatedPosts = [];

/**
* Default password for generated users
*/
const DEFAULT_PASSWORD = 'password';
private array $generatedPosts = [];

/**
* Static values for user and post counts.
Expand Down
Loading
Loading