EscolaLMS/Webinar

View on GitHub
Update swagger.yml (#75) #220
Maciej Rymarz authored 8234fe6c
complete00:00:19
1
git clone
2
codeclimate validate-config
View output
codeclimate validate-config
No errors or warnings found in .codeclimate.json.
3
codeclimate prepare
View output
codeclimate prepare
4
builder pull-engines
View output
determining required images
5
structure
View output
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
6
duplication
View output
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
7
phan
phan engine documentation
8
phpcodesniffer
phpcodesniffer engine documentation
9
phpmd
phpmd engine documentation
10
sonar-php
sonar-php engine documentation
View output
INFO: Java 1.8.0_322 Amazon.com Inc. (64-bit)
INFO: Linux 4.4.0-1128-aws amd64
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-core-2.17.0.899.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-cli-2.1.0.566.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
INFO: Index files
INFO: Invalid character encountered in file '/code/docs/menu.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/new_webinar.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/list.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: 90 files indexed
INFO: 71 source files to be analyzed
ERROR: Unable to parse file: /code/src/Jobs/ReminderAboutWebinarJob.php
ERROR: Parse error at line 15 column 13:

 5: use EscolaLms\Webinar\Services\Contracts\WebinarServiceContract;
 6: use Illuminate\Bus\Queueable;
 7: use Illuminate\Contracts\Queue\ShouldQueue;
 8: use Illuminate\Foundation\Bus\Dispatchable;
 9: use Illuminate\Queue\InteractsWithQueue;
10: use Illuminate\Queue\SerializesModels;
11: 
12: class ReminderAboutWebinarJob implements ShouldQueue
13: {
14:     use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
15:     private string $status;
                ^
16: 
17:     /**
18:      * Create a new job instance.
19:      *
20:      * @return void
21:      */
22:     public function __construct(string $status)
23:     {
24:         $this->status = $status;
25:     }

ERROR: Unable to parse file: /code/src/Services/WebinarService.php
ERROR: Parse error at line 31 column 13:

21: use EscolaLms\Youtube\Dto\YTBroadcastDto;
22: use EscolaLms\Youtube\Enum\YTStatusesEnum;
23: use EscolaLms\Youtube\Exceptions\YtAuthenticateException;
24: use EscolaLms\Youtube\Services\Contracts\YoutubeServiceContract;
25: use Illuminate\Database\Eloquent\Builder;
26: use Illuminate\Support\Facades\DB;
27: use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
28: 
29: class WebinarService implements WebinarServiceContract
30: {
31:     private WebinarRepositoryContract $webinarRepositoryContract;
                ^
32:     private JitsiServiceContract $jitsiServiceContract;
33:     private YoutubeServiceContract $youtubeServiceContract;
34: 
35:     public function __construct(
36:         WebinarRepositoryContract $webinarRepositoryContract,
37:         JitsiServiceContract      $jitsiServiceContract,
38:         YoutubeServiceContract    $youtubeServiceContract
39:     )
40:     {
41:         $this->webinarRepositoryContract = $webinarRepositoryContract;

ERROR: Unable to parse file: /code/src/Http/Controllers/WebinarController.php
ERROR: Parse error at line 26 column 13:

16: use EscolaLms\Webinar\Http\Controllers\Swagger\WebinarSwagger;
17: use EscolaLms\Core\Http\Controllers\EscolaLmsBaseController;
18: use EscolaLms\Webinar\Http\Requests\ListWebinarsRequest;
19: use EscolaLms\Webinar\Http\Requests\WebinarAssignableUserListRequest;
20: use EscolaLms\Webinar\Http\Resources\WebinarSimpleResource;
21: use EscolaLms\Webinar\Services\Contracts\WebinarServiceContract;
22: use Illuminate\Http\JsonResponse;
23: 
24: class WebinarController extends EscolaLmsBaseController implements WebinarSwagger
25: {
26:     private WebinarServiceContract $webinarServiceContract;
                ^
27:     private UserServiceContract $userService;
28: 
29:     public function __construct(
30:         WebinarServiceContract $webinarServiceContract,
31:         UserServiceContract $userService
32:     ) {
33:         $this->webinarServiceContract = $webinarServiceContract;
34:         $this->userService = $userService;
35:     }
36: 

ERROR: Unable to parse file: /code/src/Http/Controllers/WebinarAPIController.php
ERROR: Parse error at line 16 column 13:

 6: use EscolaLms\Core\Http\Controllers\EscolaLmsBaseController;
 7: use EscolaLms\Webinar\Enum\ConstantEnum;
 8: use EscolaLms\Webinar\Http\Controllers\Swagger\WebinarAPISwagger;
 9: use EscolaLms\Webinar\Http\Requests\ListWebinarsRequest;
10: use EscolaLms\Webinar\Http\Resources\WebinarSimpleResource;
11: use EscolaLms\Webinar\Services\Contracts\WebinarServiceContract;
12: use Illuminate\Http\JsonResponse;
13: 
14: class WebinarAPIController extends EscolaLmsBaseController implements WebinarAPISwagger
15: {
16:     private WebinarServiceContract $webinarServiceContract;
                ^
17: 
18:     public function __construct(
19:         WebinarServiceContract $webinarServiceContract
20:     ) {
21:         $this->webinarServiceContract = $webinarServiceContract;
22:     }
23: 
24:     public function index(ListWebinarsRequest $listWebinarsRequest): JsonResponse
25:     {
26:         $search = $listWebinarsRequest->except(['limit', 'skip', 'order', 'order_by']);

ERROR: Unable to parse file: /code/src/Helpers/StrategyHelper.php
ERROR: Parse error at line 7 column 13:

 1: <?php
 2: 
 3: namespace EscolaLms\Webinar\Helpers;
 4: 
 5: class StrategyHelper
 6: {
 7:     private string $namespace;
                ^
 8: 
 9:     public function __construct(string $baseStrategyName)
10:     {
11:         $this->setNamespace($baseStrategyName);
12:     }
13: 
14:     /**
15:      * This method used strategy pattern and execute method given in the parameters
16:      * Strategy dir it must contain minimum to file: BaseStrategy contain in pattern {{parentDir}}Strategy
17:      * in localization ?/Strategies/{{parentDir}} and strategy class in the same localization

ERROR: Unable to parse file: /code/src/Repositories/Criteria/WebinarIncomingCriterion.php
ERROR: Parse error at line 11 column 13:

 1: <?php
 2: 
 3: namespace EscolaLms\Webinar\Repositories\Criteria;
 4: 
 5: use EscolaLms\Core\Repositories\Criteria\Criterion;
 6: use Illuminate\Database\Eloquent\Builder;
 7: use Illuminate\Support\Facades\DB;
 8: 
 9: class WebinarIncomingCriterion extends Criterion
10: {
11:     private ?bool $withDuration;
                ^
12:     public function __construct(string $value, ?bool $withDuration)
13:     {
14:         parent::__construct(null, $value);
15:         $this->withDuration = $withDuration;
16:     }
17: 
18:     public function apply(Builder $query): Builder
19:     {
20:         if ($this->withDuration) {
21:             return $query

ERROR: Unable to parse file: /code/src/Repositories/Criteria/WebinarTagsCriterion.php
ERROR: Parse error at line 18 column 53:

 8: 
 9: class WebinarTagsCriterion extends Criterion
10: {
11:     public function __construct($value = null)
12:     {
13:         parent::__construct(null, $value);
14:     }
15: 
16:     public function apply(Builder $query): Builder
17:     {
18:         return $query->whereHas('tags', fn (Builder $query) =>
                                                        ^
19:             $query->whereIn('title', $this->value)
20:         );
21:     }
22: }
23: 

ERROR: Unable to parse file: /code/src/Repositories/WebinarRepository.php
ERROR: Parse error at line 50 column 54:

40: 
41:     public function deleteModel(Webinar $webinar): ?bool
42:     {
43:         return $webinar->delete();
44:     }
45: 
46:     public function forCurrentUser(array $search = [], array $criteria = []): Builder
47:     {
48:         $q = $this->allQueryBuilder($search, $criteria);
49:         $q->where(function (Builder $query) {
50:             $query->orWhereHas('users', fn ($query) =>
                                                         ^
51:                 $query->where(['users.id' => auth()->user()->getKey()])
52:             );
53:             $query->orWhereHas('trainers', fn ($query) =>
54:                 $query->where(['users.id' => auth()->user()->getKey()])
55:             );
56:         });
57:         return $q;
58:     }
59: 
60:     public function getIncomingTerm(array $criteria = []): Collection

ERROR: Unable to parse file: /code/src/Dto/FilterListDto.php
ERROR: Parse error at line 20 column 13:

10: use EscolaLms\Webinar\Repositories\Criteria\WebinarIncomingCriterion;
11: use EscolaLms\Webinar\Repositories\Criteria\WebinarSearch;
12: use EscolaLms\Core\Repositories\Criteria\Primitives\DateCriterion;
13: use EscolaLms\Core\Repositories\Criteria\Primitives\EqualCriterion;
14: use EscolaLms\Core\Repositories\Criteria\Primitives\InCriterion;
15: use EscolaLms\Webinar\Repositories\Criteria\WebinarTagsCriterion;
16: use Illuminate\Database\Eloquent\Builder;
17: 
18: class FilterListDto extends BaseDto
19: {
20:     private string $name;
                ^
21:     private array $status;
22:     private array $reminderStatus;
23:     private string $dateTo;
24:     private string $dateFrom;
25:     private string $dateTimeTo;
26:     private string $dateTimeToLowerThan;
27:     private string $dateTimeFrom;
28:     private array $tags;
29: 
30:     private string $onlyIncoming;

ERROR: Unable to parse file: /code/src/Dto/WebinarDto.php
ERROR: Parse error at line 13 column 15:

 3: namespace EscolaLms\Webinar\Dto;
 4: 
 5: use Carbon\Carbon;
 6: use EscolaLms\Webinar\Dto\Contracts\ModelDtoContract;
 7: use EscolaLms\Webinar\Enum\ConstantEnum;
 8: use EscolaLms\Webinar\Models\Webinar;
 9: use Illuminate\Support\Str;
10: 
11: class WebinarDto extends BaseDto implements ModelDtoContract
12: {
13:     protected string $name;
                  ^
14:     protected string $status;
15:     protected string $description;
16:     protected string $shortDesc;
17:     protected string $agenda;
18:     protected ?string $activeTo;
19:     protected ?string $activeFrom;
20:     protected ?string $duration;
21:     protected ?int $basePrice;
22:     protected $imagePath = false;
23:     protected $logotypePath = false;

ERROR: Unable to parse file: /code/src/Dto/Traits/DtoHelper.php
ERROR: Parse error at line 9 column 15:

 1: <?php
 2: 
 3: namespace EscolaLms\Webinar\Dto\Traits;
 4: 
 5: use Illuminate\Support\Str;
 6: 
 7: trait DtoHelper
 8: {
 9:     protected array $relations = [];
                  ^
10:     protected array $files = [];
11: 
12:     protected function setterByData(array $data): void
13:     {
14:         foreach ($data as $k => $v) {
15:             $key = preg_replace_callback('/[_|-]([a-zA-Z])/', function ($match) {
16:                 return strtoupper($match[1]);
17:             }, $k);
18:             if (method_exists($this, 'set' . $key)) {
19:                 $this->{'set' . $key}($v);

ERROR: Unable to parse file: /code/src/Events/ReminderAboutTerm.php
ERROR: Parse error at line 10 column 13:

 1: <?php
 2: 
 3: namespace EscolaLms\Webinar\Events;
 4: 
 5: use EscolaLms\Core\Models\User;
 6: use EscolaLms\Webinar\Models\Webinar as WebinarModel;
 7: 
 8: class ReminderAboutTerm extends Webinar
 9: {
10:     private string $status;
                ^
11: 
12:     public function __construct(User $user, WebinarModel $webinar, string $status)
13:     {
14:         parent::__construct($user, $webinar);
15:         $this->status = $status;
16:     }
17: 
18:     public function getStatus()
19:     {
20:         return $this->status;

ERROR: Unable to parse file: /code/src/Events/Webinar.php
ERROR: Parse error at line 14 column 13:

 4: 
 5: use EscolaLms\Core\Models\User;
 6: use EscolaLms\Webinar\Models\Webinar as WebinarModel;
 7: use Illuminate\Foundation\Events\Dispatchable;
 8: use Illuminate\Queue\SerializesModels;
 9: 
10: abstract class Webinar
11: {
12:     use Dispatchable, SerializesModels;
13: 
14:     private User $user;
                ^
15:     private WebinarModel $webinar;
16: 
17:     public function __construct(User $user, WebinarModel $webinar)
18:     {
19:         $this->user = $user;
20:         $this->webinar = $webinar;
21:     }
22: 
23:     public function getUser(): User
24:     {

ERROR: Unable to parse file: /code/src/Listeners/ReminderAboutTermListener.php
ERROR: Parse error at line 10 column 13:

 1: <?php
 2: 
 3: namespace EscolaLms\Webinar\Listeners;
 4: 
 5: use EscolaLms\Webinar\Events\ReminderAboutTerm;
 6: use EscolaLms\Webinar\Services\Contracts\WebinarServiceContract;
 7: 
 8: class ReminderAboutTermListener
 9: {
10:     private WebinarServiceContract $webinarServiceContract;
                ^
11:     /**
12:      * Create the event listener.
13:      *
14:      * @return void
15:      */
16:     public function __construct(
17:         WebinarServiceContract $webinarServiceContract
18:     ) {
19:         $this->webinarServiceContract = $webinarServiceContract;
20:     }

ERROR: Unable to parse file: /code/src/Strategies/Relations/WebinarWithTagsStrategy.php
ERROR: Parse error at line 11 column 13:

 1: <?php
 2: 
 3: namespace EscolaLms\Webinar\Strategies\Relations;
 4: 
 5: use EscolaLms\Tags\Models\Tag;
 6: use EscolaLms\Webinar\Strategies\Contracts\RelationStrategyContract;
 7: use EscolaLms\Webinar\Models\Webinar;
 8: 
 9: class WebinarWithTagsStrategy implements RelationStrategyContract
10: {
11:     private Webinar $webinar;
                ^
12:     private array $data;
13: 
14:     public function __construct(array $params) {
15:         $this->webinar = $params[0];
16:         $this->data = $params[1] ?? [];
17:     }
18: 
19:     public function setRelation(): void
20:     {
21:         if (count($this->data['tags']) === 0) {

ERROR: Unable to parse file: /code/src/Strategies/Relations/WebinarWithTrainersStrategy.php
ERROR: Parse error at line 13 column 13:

 3: namespace EscolaLms\Webinar\Strategies\Relations;
 4: 
 5: use EscolaLms\Core\Models\User;
 6: use EscolaLms\Webinar\Events\WebinarTrainerAssigned;
 7: use EscolaLms\Webinar\Events\WebinarTrainerUnassigned;
 8: use EscolaLms\Webinar\Strategies\Contracts\RelationStrategyContract;
 9: use EscolaLms\Webinar\Models\Webinar;
10: 
11: class WebinarWithTrainersStrategy implements RelationStrategyContract
12: {
13:     private Webinar $webinar;
                ^
14:     private array $data;
15: 
16:     public function __construct(array $params) {
17:         $this->webinar = $params[0];
18:         $this->data = $params[1] ?? [];
19:     }
20: 
21:     public function setRelation(): void
22:     {
23:         $changes = $this->webinar->trainers()->sync($this->data['trainers']);

ERROR: Unable to parse file: /code/src/Strategies/Relations/RelationsStrategy.php
ERROR: Parse error at line 9 column 13:

 1: <?php
 2: 
 3: namespace EscolaLms\Webinar\Strategies\Relations;
 4: 
 5: use EscolaLms\Webinar\Strategies\Contracts\RelationStrategyContract;
 6: 
 7: class RelationsStrategy
 8: {
 9:     private RelationStrategyContract $relationStrategyContract;
                ^
10: 
11:     public function __construct(
12:         RelationStrategyContract $relationStrategyContract
13:     )
14:     {
15:         $this->relationStrategyContract = $relationStrategyContract;
16:     }
17: 
18:     public function setRelation(): void
19:     {

ERROR: Unable to parse file: /code/database/seeders/WebinarsSeeder.php
ERROR: Parse error at line 21 column 32:

11:     /**
12:      * Run the database seeds.
13:      *
14:      * @return void
15:      */
16:     public function run()
17:     {
18:         $users = User::factory(5)->create();
19:         Webinar::factory(10)
20:             ->create()
21:             ->each(fn (Webinar $webinar) =>
                                   ^
22:                 $webinar->users()->sync($users->pluck('id')->toArray())
23:             );
24:     }
25: }
26: 

INFO: 71/71 source files have been analyzed
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.707s
INFO: Final Memory: 11M/95M
INFO: ------------------------------------------------------------------------