chamilo/chamilo-lms

View on GitHub
src/CoreBundle/Framework/Container.php

Summary

Maintainability
A
0 mins
Test Coverage

The class Container has a coupling between objects value of 94. Consider to reduce the number of dependencies under 13.
Open

class Container
{
    public static ?ContainerInterface $container = null;
    public static ?Request $request = null;
    // For legacy, to get the translator service is necessary get it by Container::$container->get('translator')

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

Missing function doc comment
Open

    public static function getEnvironment(): string

Missing function doc comment
Open

    public static function getMessengerBus(): MessageBusInterface

Missing function doc comment
Open

    public static function getAuthorizationChecker(): AuthorizationCheckerInterface

Missing function doc comment
Open

    public static function setRequest(Request $request): void

Missing function doc comment
Open

    public static function getLegacyHelper(): ContainerHelper

Missing function doc comment
Open

    public static function getSession(): bool|HttpSessionInterface|Session|null

Missing function doc comment
Open

    public static function getTwig(): Environment

Add a single space around assignment operators
Open

declare(strict_types=1);

Missing function doc comment
Open

    public static function getCacheDir(): string

Missing function doc comment
Open

    public static function getLogDir(): string

Missing function doc comment
Open

    public static function getProjectDir(): string

Missing function doc comment
Open

    public static function setSession(Session $session): void

Missing function doc comment
Open

    public static function setContainer(ContainerInterface $container): void

Missing function doc comment
Open

    public static function getParameter(string $parameter): array|bool|float|int|string|UnitEnum|null

Missing function doc comment
Open

    public static function isInstalled(): bool

Missing function doc comment
Open

    public static function getGradeBookCertificateRepository(): GradebookCertificateRepository

Missing function doc comment
Open

    public static function getGroupRepository(): CGroupRepository

Missing function doc comment
Open

    public static function getLpCategoryRepository(): CLpCategoryRepository

Missing function doc comment
Open

    public static function getNotebookRepository(): CNotebookRepository

Missing function doc comment
Open

    public static function getUserRepository(): UserRepository

Missing function doc comment
Open

    public static function getSessionRepository(): SessionRepository

Missing function doc comment
Open

    public static function getThematicRepository(): CThematicRepository

Missing function doc comment
Open

    public static function getTokenStorage(): TokenStorageInterface|TokenStorage

Missing function doc comment
Open

    public static function getAnnouncementRepository(): CAnnouncementRepository

Missing function doc comment
Open

    public static function getQuestionCategoryRepository(): CQuizQuestionCategoryRepository

Missing function doc comment
Open

    public static function getSequenceResourceRepository(): SequenceResourceRepository

Missing function doc comment
Open

    public static function getCourseCategoryRepository(): CourseCategoryRepository

Missing function doc comment
Open

    public static function getGlossaryRepository(): CGlossaryRepository

Missing function doc comment
Open

    public static function getThematicPlanRepository(): CThematicPlanRepository

Missing function doc comment
Open

    public static function getToolChain(): ToolChain

Missing function doc comment
Open

    public static function getCareerRepository(): CareerRepository

Missing function doc comment
Open

    public static function getExtraFieldRepository(): ExtraFieldRepository

Missing function doc comment
Open

    public static function getForumCategoryRepository(): CForumCategoryRepository

Missing function doc comment
Open

    public static function getSkillRepository(): SkillRepository

Missing function doc comment
Open

    public static function getTrackEExerciseRepository(): TrackEExerciseRepository

Missing function doc comment
Open

    public static function getTrackEDownloadsRepository(): TrackEDownloadsRepository

Missing function doc comment
Open

    public static function getThemeHelper(): ThemeHelper

Missing function doc comment
Open

    public static function getSysAnnouncementRepository(): SysAnnouncementRepository

Missing function doc comment
Open

    public static function getTagRepository(): TagRepository

Missing function doc comment
Open

    public static function getLegalRepository(): LegalRepository

Missing function doc comment
Open

    public static function getAccessUrlRepository(): AccessUrlRepository

Missing function doc comment
Open

    public static function getCalendarEventAttachmentRepository(): CCalendarEventAttachmentRepository

Missing function doc comment
Open

    public static function getLinkRepository(): CLinkRepository

Missing function doc comment
Open

    public static function getUserToJsonNormalizer(): UserToJsonNormalizer

Missing function doc comment
Open

    public static function getSurveyRepository(): CSurveyRepository

Missing function doc comment
Open

    public static function addFlash(string $message, string $type = 'success'): void

Space before opening parenthesis of function call prohibited
Open

        $type = match ($type) {

Missing function doc comment
Open

    public static function getLpRepository(): CLpRepository

Missing function doc comment
Open

    public static function getStudentPublicationCommentRepository(): CStudentPublicationCommentRepository

Missing function doc comment
Open

    public static function getSurveyQuestionRepository(): CSurveyQuestionRepository

Missing function doc comment
Open

    public static function getAssetRepository(): AssetRepository

Missing function doc comment
Open

    public static function getGradeBookCategoryRepository(): GradeBookCategoryRepository

Missing function doc comment
Open

    public static function getMessageRepository(): MessageRepository

Missing function doc comment
Open

    public static function getThematicAdvanceRepository(): CThematicAdvanceRepository

Missing function doc comment
Open

    public static function getSocialPostRepository(): SocialPostRepository

Missing function doc comment
Open

    public static function getAnnouncementAttachmentRepository(): CAnnouncementAttachmentRepository

Missing function doc comment
Open

    public static function getTicketMessageAttachmentRepository(): TicketMessageAttachmentRepository

Missing function doc comment
Open

    public static function getSocialPostAttachmentRepository(): SocialPostAttachmentRepository

Missing function doc comment
Open

    public static function getQuizCategoryRepository(): CQuizCategoryRepository

Missing function doc comment
Open

    public static function getGroupCategoryRepository(): CGroupCategoryRepository

Missing function doc comment
Open

    public static function getForumPostRepository(): CForumPostRepository

Missing function doc comment
Open

    public static function getQuizRepository(): CQuizRepository

Missing function doc comment
Open

    public static function getStudentPublicationCorrectionRepository(): CStudentPublicationCorrectionRepository

Missing function doc comment
Open

    public static function getCourseSettingsManager(): SettingsCourseManager

Missing function doc comment
Open

    public static function getForumRepository(): CForumRepository

Missing function doc comment
Open

    public static function getForumAttachmentRepository(): CForumAttachmentRepository

Missing function doc comment
Open

    public static function getLinkCategoryRepository(): CLinkCategoryRepository

Missing function doc comment
Open

    public static function getPersonalFileRepository(): PersonalFileRepository

Missing function doc comment
Open

    public static function getUsergroupRepository(): UsergroupRepository

Missing function doc comment
Open

    public static function getTrackELoginRecordRepository(): TrackELoginRecordRepository

Missing function doc comment
Open

    public static function getAttendanceRepository(): CAttendanceRepository

Missing function doc comment
Open

    public static function getCourseRepository(): CourseRepository

Missing function doc comment
Open

    public static function getCalendarEventRepository(): CCalendarEventRepository

Missing function doc comment
Open

    public static function getExtraFieldOptionsRepository(): ExtraFieldOptionsRepository

Missing function doc comment
Open

    public static function getQuestionRepository(): CQuizQuestionRepository

Missing function doc comment
Open

    public static function setLegacyServices(ContainerInterface $container): void

Missing function doc comment
Open

    public static function getLpItemRepository(): CLpItemRepository

Missing function doc comment
Open

    public static function getShortcutRepository(): CShortcutRepository

Missing function doc comment
Open

    public static function getStudentPublicationRepository(): CStudentPublicationRepository

Missing function doc comment
Open

    public static function getSequenceRepository(): SequenceRepository

Missing function doc comment
Open

    public static function getForumThreadRepository(): CForumThreadRepository

Missing function doc comment
Open

    public static function getMessageAttachmentRepository(): MessageAttachmentRepository

Missing function doc comment
Open

    public static function getPromotionRepository(): PromotionRepository

Missing function doc comment
Open

    public static function getWikiRepository(): CWikiRepository

Missing function doc comment
Open

    public static function getMailer(): Mailer

Missing function doc comment
Open

    public static function getResourceNodeRepository(): ResourceNodeRepository

Missing function doc comment
Open

    public static function getCourseDescriptionRepository(): CCourseDescriptionRepository

Missing function doc comment
Open

    public static function getDocumentRepository(): CDocumentRepository

Missing function doc comment
Open

    public static function getExternalToolRepository(): ExternalToolRepository

Missing function doc comment
Open

    public static function getIllustrationRepository(): IllustrationRepository

Missing function doc comment
Open

    public static function getStudentPublicationAssignmentRepository(): CStudentPublicationAssignmentRepository

Missing function doc comment
Open

    public static function getSettingsManager(): SettingsManager

Missing function doc comment
Open

    public static function getLanguageRepository(): LanguageRepository

Missing function doc comment
Open

    public static function getSurveyInvitationRepository(): CSurveyInvitationRepository

Missing function doc comment
Open

    public static function getToolIntroRepository(): CToolIntroRepository

Missing function doc comment
Open

    public static function getFormFactory(): FormFactory

Missing function doc comment
Open

    public static function getRouter(): Router

Line indented incorrectly; expected 8 spaces, found 12
Open

            default => 'info',

Space before opening parenthesis of function call prohibited
Open

        $type = match ($type) {

Line indented incorrectly; expected at least 16 spaces, found 12
Open

            $session->getFlashBag()->add($type, $message);

Line indented incorrectly; expected 12 spaces, found 8
Open

        if ($session instanceof Session) {

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        $session = self::getSession();

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

There are no issues that match your filters.

Category
Status