Method boot
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function boot()
{
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
$this->mergeConfigFrom(__DIR__ . '/../config/topic-h5p.php', 'topic-h5p');
if ($this->app->runningInConsole()) {
The class EscolaLmsTopicTypesServiceProvider has a coupling between objects value of 45. Consider to reduce the number of dependencies under 13. Open
class EscolaLmsTopicTypesServiceProvider extends ServiceProvider
{
public $singletons = [
TopicTypeServiceContract::class => TopicTypeService::class,
];
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Avoid using static access to class '\EscolaLms\Courses\Facades\Topic' in method 'boot'. Open
Topic::registerResourceClasses(Image::class, [
'client' => ClientImageResource::class,
'admin' => AdminImageResource::class,
'export' => ExportImageResource::class,
]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\EscolaLms\Courses\Facades\Topic' in method 'boot'. Open
Topic::registerResourceClasses(Cmi5Au::class, [
'client' => ClientCmi5AuResource::class,
'admin' => AdminCmi5AuResource::class,
'export' => ExportCmi5AuResource::class,
]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\EscolaLms\Courses\Facades\Topic' in method 'boot'. Open
Topic::registerResourceClasses(OEmbed::class, [
'client' => ClientOEmbedResource::class,
'admin' => AdminOEmbedResource::class,
'export' => ExportOEmbedResource::class,
]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\EscolaLms\Courses\Facades\Topic' in method 'boot'. Open
Topic::registerContentClasses([
Cmi5Au::class
]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\EscolaLms\Courses\Facades\Topic' in method 'boot'. Open
Topic::registerResourceClasses(Audio::class, [
'client' => ClientAudioResource::class,
'admin' => AdminAudioResource::class,
'export' => ExportAudioResource::class,
]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\EscolaLms\Courses\Facades\Topic' in method 'boot'. Open
Topic::registerResourceClasses(RichText::class, [
'client' => ClientRichTextResource::class,
'admin' => AdminRichTextResource::class,
'export' => ExportRichTextResource::class,
]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\EscolaLms\HeadlessH5P\Repositories\H5PContentRepository' in method 'register'. Open
H5PContentRepository::extendQueryGroupBy(
fn () => [
'hh5p_contents.id',
'hh5p_contents.uuid',
'hh5p_contents.library_id',
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\EscolaLms\Courses\Facades\Topic' in method 'boot'. Open
Topic::registerResourceClasses(Video::class, [
'client' => ClientVideoResource::class,
'admin' => AdminVideoResource::class,
'export' => ExportVideoResource::class,
]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\EscolaLms\HeadlessH5P\Repositories\H5PContentRepository' in method 'register'. Open
H5PContentRepository::extendQuerySelect(
fn () => DB::raw("COUNT(topic_h5ps.value) as count_h5p"),
'topic_h5ps'
);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\EscolaLms\Courses\Facades\Topic' in method 'boot'. Open
Topic::registerResourceClasses(PDF::class, [
'client' => ClientPDFResource::class,
'admin' => AdminPDFResource::class,
'export' => ExportPDFResource::class,
]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\EscolaLms\HeadlessH5P\Http\Resources\ContentIndexResource' in method 'register'. Open
ContentIndexResource::extend(fn ($thisObj) => [
'count_h5p' => $thisObj->count_h5p,
]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Illuminate\Support\Facades\DB' in method 'register'. Open
DB::Connection() instanceof PostgresConnection ? 'hh5p_contents.parameters::jsonb' : 'hh5p_contents.parameters',
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\EscolaLms\Courses\Facades\Topic' in method 'boot'. Open
Topic::registerResourceClasses(H5P::class, [
'client' => ClientH5PResource::class,
'admin' => AdminH5PResource::class,
'export' => ExportH5PResource::class,
]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\EscolaLms\Courses\Facades\Topic' in method 'boot'. Open
Topic::registerResourceClasses(ScormSco::class, [
'client' => ClientScormScoResource::class,
'admin' => AdminScormScoResource::class,
'export' => ExportScormScoResource::class,
]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Illuminate\Support\Facades\DB' in method 'register'. Open
fn () => DB::raw("COUNT(topic_h5ps.value) as count_h5p"),
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\EscolaLms\Courses\Facades\Topic' in method 'boot'. Open
Topic::registerContentClasses([
Audio::class,
Video::class,
Image::class,
RichText::class,
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\EscolaLms\HeadlessH5P\Repositories\H5PContentRepository' in method 'register'. Open
H5PContentRepository::extendQueryJoin(
fn () => [['topic_h5ps.value', 'hh5p_contents.id']],
'topic_h5ps'
);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Only one argument is allowed per line in a multi-line function call Open
fn () => [['topic_h5ps.value', 'hh5p_contents.id']],
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
DB::Connection() instanceof PostgresConnection ? 'hh5p_contents.parameters::jsonb' : 'hh5p_contents.parameters',
- Exclude checks
Space before opening parenthesis of function call prohibited Open
fn () => DB::raw("COUNT(topic_h5ps.value) as count_h5p"),
- Exclude checks
Space before opening parenthesis of function call prohibited Open
fn () => [
- Exclude checks
Space before opening parenthesis of function call prohibited Open
fn () => [['topic_h5ps.value', 'hh5p_contents.id']],
- Exclude checks
Multi-line function call not indented correctly; expected 12 spaces but found 16 Open
'hh5p_contents.uuid',
- Exclude checks
Multi-line function call not indented correctly; expected 12 spaces but found 16 Open
DB::Connection() instanceof PostgresConnection ? 'hh5p_contents.parameters::jsonb' : 'hh5p_contents.parameters',
- Exclude checks
Multi-line function call not indented correctly; expected 12 spaces but found 16 Open
'hh5p_contents.library_id',
- Exclude checks
Multi-line function call not indented correctly; expected 12 spaces but found 16 Open
'hh5p_contents.user_id',
- Exclude checks
Multi-line function call not indented correctly; expected 12 spaces but found 16 Open
'hh5p_contents.author',
- Exclude checks
Multi-line function call not indented correctly; expected 12 spaces but found 16 Open
'hh5p_contents.created_at',
- Exclude checks
Multi-line function call not indented correctly; expected 12 spaces but found 16 Open
'hh5p_contents.id',
- Exclude checks
Space before opening parenthesis of function call prohibited Open
ContentIndexResource::extend(fn ($thisObj) => [
- Exclude checks