Failed Conditions
Pull Request — master (#343)
by Rafael
02:10
created

EmailTemplatesMapper::mapToObject()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 10
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 13
rs 9.9332
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Canvas\Mapper;
6
7
use AutoMapperPlus\CustomMapper\CustomMapper;
0 ignored issues
show
Bug introduced by
The type AutoMapperPlus\CustomMapper\CustomMapper was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Canvas\Models\Subscription;
9
10
// You can either extend the CustomMapper, or just implement the MapperInterface
11
// directly.
12
class EmailTemplatesMapper extends CustomMapper
13
{
14
    /**
15
     * @param Baka\Database\CustomFilters\CustomFilters $filter
0 ignored issues
show
Bug introduced by
The type Canvas\Mapper\Baka\Datab...omFilters\CustomFilters was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
     * @param \Canvas\Dto\CustomFilter $filterSchema
17
     * @return ListSchema
18
     */
19
    public function mapToObject($emailTemplates, $emailTemplatesDto, array $context = [])
20
    {
21
        $emailTemplatesDto->id = $emailTemplates->getId();
22
        $emailTemplatesDto->companies_id = $emailTemplates->companies_id;
23
        $emailTemplatesDto->app_id = $emailTemplates->app_id;
24
        $emailTemplatesDto->name = $emailTemplates->name;
25
        $emailTemplatesDto->template = urldecode($emailTemplates->template) ?: $emailTemplates->template;
26
        $emailTemplatesDto->users_id = $emailTemplates->users_id;
27
        $emailTemplatesDto->created_at = $emailTemplates->created_at;
28
        $emailTemplatesDto->updated_at = $emailTemplates->updated_at;
29
        $emailTemplatesDto->is_deleted = $emailTemplates->is_deleted;
30
31
        return $emailTemplatesDto;
32
    }
33
}
34