Skip to content

Commit

Permalink
requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioRadu committed Oct 25, 2023
1 parent d84c656 commit c68bd83
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 68 deletions.
41 changes: 41 additions & 0 deletions config/autoload/debugbar.local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

return [
Dot\DebugBar\DebugBar::class => [
/**
* Enable/Disable DebugBar
*/
'enabled' => false,

/**
* Enable DebugBar by whitelisting your IPV4 address
*/
'ipv4Whitelist' => [
'127.0.0.1',
],

/**
* Enable DebugBar by whitelisting your IPV6 address
*/
'ipv6Whitelist' => [
'::1',
],

/**
* @see \DebugBar\JavascriptRenderer::setOptions()
*/
'javascript_renderer' => [
'base_url' => '',
'base_path' => '',
'disable_jquery' => true,
'disable_fontawesome' => false,
'disable_highlightjs' => false,
],
'application' => [
'name' => 'DotKernel',
'url' => 'a',
],
],
];
6 changes: 3 additions & 3 deletions config/autoload/debugbar.local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ return [
* @see \DebugBar\JavascriptRenderer::setOptions()
*/
'javascript_renderer' => [
'base_url' => '',
'base_path' => '',
'disable_jquery' => true,
'base_url' => '',
'base_path' => '',
'disable_jquery' => true,
'disable_fontawesome' => false,
'disable_highlightjs' => false,
],
Expand Down
59 changes: 28 additions & 31 deletions config/autoload/local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,41 @@ $baseUrl = 'http://dotkernel.local';

$databases = [
'default' => [
'host' => 'localhost',
'dbname' => '',
'user' => '',
'host' => 'localhost',
'dbname' => '',
'user' => '',
'password' => '',
'port' => 3306,
'driver' => 'pdo_mysql',
'charset' => 'utf8mb4',
'collate' => 'utf8mb4_general_ci',
'port' => 3306,
'driver' => 'pdo_mysql',
'charset' => 'utf8mb4',
'collate' => 'utf8mb4_general_ci',
],
// you can add more database connections into this array
];

return [
'annotations_cache_dir' => getcwd() . '/data/cache/annotations',
'application' => [
'application' => [
'name' => 'DotKernel',
'url' => $baseUrl,
'url' => $baseUrl,
],
'databases' => $databases,
'doctrine' => [
'databases' => $databases,
'doctrine' => [
'connection' => [
'orm_default' => [
'params' => $databases['default'],
],
],
],
'uploads' => [
'uploads' => [
'user' => [
'url' => $baseUrl . '/uploads/user',
'path' => \realpath(__DIR__ . '/../../public/uploads/user'),
'path' => realpath(__DIR__ . '/../../public/uploads/user'),
],
],
'contact' => [
'notification_receivers' => [
],
'message_receivers' => [
'contact' => [
'notification_receivers' => [],
'message_receivers' => [
'to' => [
'[email protected]',
],
Expand All @@ -57,31 +56,29 @@ return [
],
],
],
'translator' => [
'cookie' => [
'name' => 'dk30Translator',
'translator' => [
'cookie' => [
'name' => 'dk30Translator',
'lifetime' => 3600 * 24 * 30,
],

'default' => 'en',
'locale' => [
'default' => 'en',
'locale' => [
'en' => 'en_EN',
'dk' => 'da_DK',
],
'code_set' => 'UTF-8',
'domain' => 'messages',
'domain' => 'messages',
'base_dir' => getcwd() . '/data/language',
],
'recaptcha' => [
'recaptcha' => [
'scoreThreshold' => 0.5,
'siteKey' => '',
'secretKey' => '',
'verifyUrl' => 'https://www.google.com/recaptcha/api/siteverify',
'siteKey' => '',
'secretKey' => '',
'verifyUrl' => 'https://www.google.com/recaptcha/api/siteverify',
],

'rememberMe' => [
'rememberMe' => [
'cookie' => [
'name' => 'rememberMe',
'name' => 'rememberMe',
'lifetime' => 3600 * 24 * 30,
],
],
Expand Down
29 changes: 13 additions & 16 deletions config/autoload/mail.local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ return [
/**
* Dotkernel mail module configuration
* Note that many of these options can be set programmaticaly too, when sending mail messages
* actually that is what you'll usually do, these config provide just default and options that remain the same for all mails
* actually that is what you'll usually do, these config provide just default and options that
* remain the same for all mails
*/

'dot_mail' => [
//the key is the mail service name, this is the default one, which does not extends any configuration
'default' => [
Expand All @@ -28,11 +28,10 @@ return [
*
* defaults to sendmail
**/

'transport' => Laminas\Mail\Transport\Sendmail::class,

// Uncomment the below line if you want to save a copy of all sent emails to a certain IMAP folder
// Valid only if the Transport is SMTP
// Valid only if the Transport is SMTP
// 'save_sent_message_folder' => ['INBOX.Sent'],

//message configuration
Expand Down Expand Up @@ -65,19 +64,17 @@ return [
//body options - content can be plain text, HTML
'body' => [
'content' => '',

'charset' => 'utf-8',
],

//attachments config
'attachments' => [
'files' => [],

'dir' => [
'iterate' => false,
'path' => 'data/mail/attachments',
'dir' => [
'iterate' => false,
'path' => 'data/mail/attachments',
'recursive' => false,
]
],
],
],

Expand All @@ -92,8 +89,7 @@ return [

//connection class used for authentication
//the value can be one of smtp, plain, login or crammd5
'connection_class' => 'login',

'connection_class' => 'login',
'connection_config' => [

//the smtp authentication identity
Expand All @@ -105,7 +101,7 @@ return [
//the encryption type to be used, ssl or tls
//null should be used to disable SSL
'ssl' => 'ssl',
]
],
],

//file options that will be used only if the adapter is Laminas\Mail\Transport\File
Expand All @@ -115,7 +111,8 @@ return [
//default value is 'data/mail/output'
'path' => 'data/mail/output',

//a callable that will get the Laminas\Mail\Transport\File object as an argument and should return the filename
//a callable that will get the Laminas\Mail\Transport\File object as an argument
// and should return the filename
//if null is used, and empty callable will be used
//'callback' => null,
],*/
Expand All @@ -130,7 +127,7 @@ return [
],
// option to log the SENT emails
'log' => [
'sent' => getcwd() . '/log/mail/sent.log'
'sent' => getcwd() . '/log/mail/sent.log',
],

/**
Expand Down
5 changes: 5 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@
<code>getCookieSameSite</code>
</UndefinedInterfaceMethod>
</file>
<file src="src/User/src/Entity/UserIdentity.php">
<LessSpecificImplementedReturnType>
<code>iterable</code>
</LessSpecificImplementedReturnType>
</file>
</files>
1 change: 0 additions & 1 deletion src/App/src/Service/RecaptchaService.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public function isValid(): bool

$response = curl_exec($curl);

/** @psalm-suppress InvalidScalarArgument */
$response = json_decode($response, true);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);

Expand Down
4 changes: 0 additions & 4 deletions src/Contact/src/Service/MessageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Doctrine\ORM\EntityRepository;
use Dot\AnnotatedServices\Annotation\Inject;
use Dot\Mail\Exception\MailException;
use Dot\Mail\Service\MailServiceInterface;
use Frontend\Contact\Entity\Message;
use Frontend\Contact\Repository\MessageRepository;
Expand Down Expand Up @@ -35,9 +34,6 @@ public function getRepository(): MessageRepository|EntityRepository
return $this->repository;
}

/**
* @throws MailException
*/
public function processMessage(array $data): bool
{
$message = new Message(
Expand Down
4 changes: 0 additions & 4 deletions src/Contact/src/Service/MessageServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Frontend\Contact\Service;

use Doctrine\ORM\EntityRepository;
use Dot\Mail\Exception\MailException;
use Frontend\Contact\Entity\Message;
use Frontend\Contact\Repository\MessageRepository;

Expand All @@ -15,8 +14,5 @@ public function getRepository(): MessageRepository|EntityRepository;

public function processMessage(array $data): bool;

/**
* @throws MailException
*/
public function sendContactMail(Message $message): bool;
}
3 changes: 0 additions & 3 deletions src/Page/src/Service/PageServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

namespace Frontend\Page\Service;

/**
* Interface PageService
*/
interface PageServiceInterface
{
}
1 change: 0 additions & 1 deletion src/User/src/Entity/UserIdentity.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public function getIdentity(): string

/**
* @return iterable
* @psalm-suppress LessSpecificImplementedReturnType
*/
public function getRoles(): iterable
{
Expand Down
5 changes: 0 additions & 5 deletions src/User/src/Entity/UserRememberMe.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ class UserRememberMe extends AbstractEntity
/** @ORM\Column(name="expireDate", type="datetime_immutable") */
protected DateTimeImmutable $expireDate;

public function __construct()
{
parent::__construct();
}

public function getUser(): User
{
return $this->user;
Expand Down

0 comments on commit c68bd83

Please sign in to comment.