Skip to content

Commit d3ec59c

Browse files
committed
fixed conflicts
Signed-off-by: MarioRadu <[email protected]>
2 parents 8384552 + 2439e4d commit d3ec59c

File tree

16 files changed

+101
-53
lines changed

16 files changed

+101
-53
lines changed

.laminas-ci/pre-run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [[ ${COMMAND} =~ phpunit ]];then
99
apt-get install php"${PHP_VERSION}"-sqlite3
1010

1111
cp config/autoload/local.php.dist config/autoload/local.php
12-
cp config/autoload/mail.local.php.dist config/autoload/mail.local.php
12+
cp config/autoload/mail.global.php.dist config/autoload/mail.global.php
1313
cp config/autoload/local.test.php.dist config/autoload/local.test.php
1414

1515
fi

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"dotkernel/dot-data-fixtures": "^1.2.2",
5757
"dotkernel/dot-dependency-injection": "^1.0",
5858
"dotkernel/dot-errorhandler": "^4.0.0",
59-
"dotkernel/dot-mail": "^4.1.1",
59+
"dotkernel/dot-mail": "^5.1.0",
6060
"dotkernel/dot-response-header": "^3.2.3",
6161
"laminas/laminas-component-installer": "^3.4.0",
6262
"laminas/laminas-config-aggregator": "^1.14.0",
@@ -78,7 +78,7 @@
7878
"zircote/swagger-php": "^4.10"
7979
},
8080
"require-dev": {
81-
"laminas/laminas-coding-standard": "^2.5",
81+
"laminas/laminas-coding-standard": "^3.0",
8282
"laminas/laminas-development-mode": "^3.12.0",
8383
"mezzio/mezzio-tooling": "^2.9.0",
8484
"phpstan/phpstan": "^2.0",
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
return [
6+
/**
7+
* Dotkernel mail module configuration
8+
* Note that many of these options can be set programmatically too, when sending mail messages actually that is
9+
* what you'll usually do, these configs provide just defaults and options that remain the same for all mails
10+
*/
11+
'dot_mail' => [
12+
//the key is the mail service name, this is the default one, which does not extend any configuration
13+
'default' => [
14+
//message configuration
15+
'message_options' => [
16+
//from email address of the email
17+
'from' => '',
18+
//from name to be displayed instead of from address
19+
'from_name' => '',
20+
//reply-to email address of the email
21+
'reply_to' => '',
22+
//replyTo name to be displayed instead of the address
23+
'reply_to_name' => '',
24+
//destination email address as string or a list of email addresses
25+
'to' => [],
26+
//copy destination addresses
27+
'cc' => [],
28+
//hidden copy destination addresses
29+
'bcc' => [],
30+
//email subject
31+
'subject' => '',
32+
//body options - content can be plain text, HTML
33+
'body' => [
34+
'content' => '',
35+
'charset' => 'utf-8',
36+
],
37+
//attachments config
38+
'attachments' => [
39+
'files' => [],
40+
'dir' => [
41+
'iterate' => false,
42+
'path' => 'data/mail/attachments',
43+
'recursive' => false,
44+
],
45+
],
46+
],
47+
/**
48+
* the mail transport to use can be any class implementing
49+
* Symfony\Component\Mailer\Transport\TransportInterface
50+
*
51+
* for standard mail transports, you can use these aliases:
52+
* - sendmail => Symfony\Component\Mailer\Transport\SendmailTransport
53+
* - esmtp => Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport
54+
*
55+
* defaults to sendmail
56+
**/
57+
'transport' => 'sendmail',
58+
//options that will be used only if esmtp adapter is used
59+
'smtp_options' => [
60+
//hostname or IP address of the mail server
61+
'host' => '',
62+
//port of the mail server - 587 or 465 for secure connections
63+
'port' => 587,
64+
'connection_config' => [
65+
//the smtp authentication identity
66+
'username' => '',
67+
//the smtp authentication credential
68+
'password' => '',
69+
//to disable auto_tls set tls key to false
70+
//it's not recommended to disable TLS while connecting to an SMTP server
71+
'tls' => null,
72+
],
73+
],
74+
],
75+
// option to log the SENT emails
76+
'log' => [
77+
'sent' => getcwd() . '/log/mail/sent.log',
78+
],
79+
],
80+
];

config/config.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
Laminas\Filter\ConfigProvider::class,
2626
Laminas\HttpHandlerRunner\ConfigProvider::class,
2727
Laminas\Hydrator\ConfigProvider::class,
28-
Laminas\Mail\ConfigProvider::class,
2928
Laminas\Validator\ConfigProvider::class,
3029
// Include cache configuration
3130
new Laminas\ConfigAggregator\ArrayProvider($cacheConfig),

data/doctrine/fixtures/UserLoader.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public function load(ObjectManager $manager): void
3434
->setIdentity('[email protected]')
3535
->usePassword('dotkernel')
3636
->setStatus(UserStatusEnum::Active)
37-
->setIsDeleted(false)
3837
->setHash(User::generateHash())
3938
->addRole($guestRole)
4039
->addRole($userRole);

data/doctrine/migrations/Version20241030082958.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
3030
$this->addSql('CREATE TABLE oauth_clients (id INT UNSIGNED AUTO_INCREMENT NOT NULL, name VARCHAR(40) NOT NULL, secret VARCHAR(100) DEFAULT NULL, redirect VARCHAR(191) NOT NULL, revoked TINYINT(1) DEFAULT 0 NOT NULL, isConfidential TINYINT(1) DEFAULT 0 NOT NULL, user_id BINARY(16) DEFAULT NULL, INDEX IDX_13CE8101A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4');
3131
$this->addSql('CREATE TABLE oauth_refresh_tokens (id INT UNSIGNED AUTO_INCREMENT NOT NULL, revoked TINYINT(1) DEFAULT 0 NOT NULL, expires_at DATETIME NOT NULL, access_token_id INT UNSIGNED DEFAULT NULL, INDEX IDX_5AB6872CCB2688 (access_token_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4');
3232
$this->addSql('CREATE TABLE oauth_scopes (id INT UNSIGNED AUTO_INCREMENT NOT NULL, scope VARCHAR(191) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4');
33-
$this->addSql('CREATE TABLE user (uuid BINARY(16) NOT NULL, identity VARCHAR(191) NOT NULL, password VARCHAR(191) NOT NULL, status ENUM(\'active\', \'pending\') DEFAULT \'pending\' NOT NULL, isDeleted TINYINT(1) NOT NULL, hash VARCHAR(64) NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D6496A95E9C4 (identity), UNIQUE INDEX UNIQ_8D93D649D1B862B8 (hash), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4');
33+
$this->addSql('CREATE TABLE user (uuid BINARY(16) NOT NULL, identity VARCHAR(191) NOT NULL, password VARCHAR(191) NOT NULL, status ENUM(\'active\', \'pending\', \'deleted\') DEFAULT \'pending\' NOT NULL, hash VARCHAR(64) NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D6496A95E9C4 (identity), UNIQUE INDEX UNIQ_8D93D649D1B862B8 (hash), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4');
3434
$this->addSql('CREATE TABLE user_roles (userUuid BINARY(16) NOT NULL, roleUuid BINARY(16) NOT NULL, INDEX IDX_54FCD59FD73087E9 (userUuid), INDEX IDX_54FCD59F88446210 (roleUuid), PRIMARY KEY(userUuid, roleUuid)) DEFAULT CHARACTER SET utf8mb4');
3535
$this->addSql('CREATE TABLE user_avatar (uuid BINARY(16) NOT NULL, name VARCHAR(191) NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, userUuid BINARY(16) DEFAULT NULL, UNIQUE INDEX UNIQ_73256912D73087E9 (userUuid), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4');
3636
$this->addSql('CREATE TABLE user_detail (uuid BINARY(16) NOT NULL, firstName VARCHAR(191) DEFAULT NULL, lastName VARCHAR(191) DEFAULT NULL, email VARCHAR(191) NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, userUuid BINARY(16) DEFAULT NULL, UNIQUE INDEX UNIQ_4B5464AED73087E9 (userUuid), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4');

phpcs.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@
1919
<file>test</file>
2020

2121
<!-- Include all rules from the Laminas Coding Standard -->
22-
<rule ref="LaminasCodingStandard"/>
22+
<rule ref="LaminasCodingStandard">
23+
<!-- Exclude rule -->
24+
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName" />
25+
</rule>
2326
</ruleset>

src/User/src/Entity/User.php

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ class User extends AbstractEntity implements UserEntityInterface
5151
#[ORM\Column(type: 'user_status_enum', options: ['default' => UserStatusEnum::Pending])]
5252
protected UserStatusEnum $status = UserStatusEnum::Pending;
5353

54-
#[ORM\Column(name: "isDeleted", type: "boolean")]
55-
protected bool $isDeleted = false;
56-
5754
#[ORM\Column(name: "hash", type: "string", length: 64, unique: true)]
5855
protected string $hash;
5956

@@ -103,18 +100,6 @@ public function setStatus(UserStatusEnum $status): self
103100
return $this;
104101
}
105102

106-
public function isDeleted(): bool
107-
{
108-
return $this->isDeleted;
109-
}
110-
111-
public function setIsDeleted(bool $isDeleted): self
112-
{
113-
$this->isDeleted = $isDeleted;
114-
115-
return $this;
116-
}
117-
118103
public function getHash(): string
119104
{
120105
return $this->hash;
@@ -273,11 +258,9 @@ public function isPending(): bool
273258
return $this->status === UserStatusEnum::Pending;
274259
}
275260

276-
public function markAsDeleted(): self
261+
public function isDeleted(): bool
277262
{
278-
$this->isDeleted = true;
279-
280-
return $this;
263+
return $this->status === UserStatusEnum::Deleted;
281264
}
282265

283266
public function renewHash(): self
@@ -311,7 +294,6 @@ public function getArrayCopy(): array
311294
'hash' => $this->getHash(),
312295
'identity' => $this->getIdentity(),
313296
'status' => $this->getStatus(),
314-
'isDeleted' => $this->isDeleted(),
315297
'avatar' => $this->getAvatar()?->getArrayCopy(),
316298
'detail' => $this->getDetail()->getArrayCopy(),
317299
'roles' => $this->getRoles()->map(function (UserRole $userRole) {

src/User/src/Enum/UserStatusEnum.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ enum UserStatusEnum: string
88
{
99
case Active = 'active';
1010
case Pending = 'pending';
11+
case Deleted = 'deleted';
1112
}

src/User/src/OpenAPI.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,6 @@
10671067
new OA\Property(property: 'hash', type: 'string'),
10681068
new OA\Property(property: 'identity', type: 'string'),
10691069
new OA\Property(property: 'status', type: 'string', example: UserStatusEnum::Active),
1070-
new OA\Property(property: 'isDeleted', type: 'boolean', example: false),
10711070
new OA\Property(property: 'avatar', ref: '#/components/schemas/UserAvatar', nullable: true),
10721071
new OA\Property(property: 'detail', ref: '#/components/schemas/UserDetail'),
10731072
new OA\Property(

0 commit comments

Comments
 (0)