src/CoreBundle/Framework/Container.php
The class Container has a coupling between objects value of 94. Consider to reduce the number of dependencies under 13. Open
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')
- 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
Missing function doc comment Open
Open
public static function getEnvironment(): string
- Exclude checks
Missing function doc comment Open
Open
public static function getMessengerBus(): MessageBusInterface
- Exclude checks
Missing function doc comment Open
Open
public static function getAuthorizationChecker(): AuthorizationCheckerInterface
- Exclude checks
Missing function doc comment Open
Open
public static function setRequest(Request $request): void
- Exclude checks
Missing function doc comment Open
Open
public static function getLegacyHelper(): ContainerHelper
- Exclude checks
Missing function doc comment Open
Open
public static function getSession(): bool|HttpSessionInterface|Session|null
- Exclude checks
Missing function doc comment Open
Open
public static function getTwig(): Environment
- Exclude checks
Add a single space around assignment operators Open
Open
declare(strict_types=1);
- Exclude checks
Missing function doc comment Open
Open
public static function getCacheDir(): string
- Exclude checks
Missing function doc comment Open
Open
public static function getLogDir(): string
- Exclude checks
Missing function doc comment Open
Open
public static function getProjectDir(): string
- Exclude checks
Missing function doc comment Open
Open
public static function setSession(Session $session): void
- Exclude checks
Missing function doc comment Open
Open
public static function setContainer(ContainerInterface $container): void
- Exclude checks
Missing function doc comment Open
Open
public static function getParameter(string $parameter): array|bool|float|int|string|UnitEnum|null
- Exclude checks
Missing function doc comment Open
Open
public static function isInstalled(): bool
- Exclude checks
Missing function doc comment Open
Open
public static function getGradeBookCertificateRepository(): GradebookCertificateRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getGroupRepository(): CGroupRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getLpCategoryRepository(): CLpCategoryRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getNotebookRepository(): CNotebookRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getUserRepository(): UserRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getSessionRepository(): SessionRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getThematicRepository(): CThematicRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getTokenStorage(): TokenStorageInterface|TokenStorage
- Exclude checks
Missing function doc comment Open
Open
public static function getAnnouncementRepository(): CAnnouncementRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getQuestionCategoryRepository(): CQuizQuestionCategoryRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getSequenceResourceRepository(): SequenceResourceRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getCourseCategoryRepository(): CourseCategoryRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getGlossaryRepository(): CGlossaryRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getThematicPlanRepository(): CThematicPlanRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getToolChain(): ToolChain
- Exclude checks
Missing function doc comment Open
Open
public static function getCareerRepository(): CareerRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getExtraFieldRepository(): ExtraFieldRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getForumCategoryRepository(): CForumCategoryRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getSkillRepository(): SkillRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getTrackEExerciseRepository(): TrackEExerciseRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getTrackEDownloadsRepository(): TrackEDownloadsRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getThemeHelper(): ThemeHelper
- Exclude checks
Missing function doc comment Open
Open
public static function getSysAnnouncementRepository(): SysAnnouncementRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getTagRepository(): TagRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getLegalRepository(): LegalRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getAccessUrlRepository(): AccessUrlRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getCalendarEventAttachmentRepository(): CCalendarEventAttachmentRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getLinkRepository(): CLinkRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getUserToJsonNormalizer(): UserToJsonNormalizer
- Exclude checks
Missing function doc comment Open
Open
public static function getSurveyRepository(): CSurveyRepository
- Exclude checks
Missing function doc comment Open
Open
public static function addFlash(string $message, string $type = 'success'): void
- Exclude checks
Space before opening parenthesis of function call prohibited Open
Open
$type = match ($type) {
- Exclude checks
Missing function doc comment Open
Open
public static function getLpRepository(): CLpRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getStudentPublicationCommentRepository(): CStudentPublicationCommentRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getSurveyQuestionRepository(): CSurveyQuestionRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getAssetRepository(): AssetRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getGradeBookCategoryRepository(): GradeBookCategoryRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getMessageRepository(): MessageRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getThematicAdvanceRepository(): CThematicAdvanceRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getSocialPostRepository(): SocialPostRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getAnnouncementAttachmentRepository(): CAnnouncementAttachmentRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getTicketMessageAttachmentRepository(): TicketMessageAttachmentRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getSocialPostAttachmentRepository(): SocialPostAttachmentRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getQuizCategoryRepository(): CQuizCategoryRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getGroupCategoryRepository(): CGroupCategoryRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getForumPostRepository(): CForumPostRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getQuizRepository(): CQuizRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getStudentPublicationCorrectionRepository(): CStudentPublicationCorrectionRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getCourseSettingsManager(): SettingsCourseManager
- Exclude checks
Missing function doc comment Open
Open
public static function getForumRepository(): CForumRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getForumAttachmentRepository(): CForumAttachmentRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getLinkCategoryRepository(): CLinkCategoryRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getPersonalFileRepository(): PersonalFileRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getUsergroupRepository(): UsergroupRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getTrackELoginRecordRepository(): TrackELoginRecordRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getAttendanceRepository(): CAttendanceRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getCourseRepository(): CourseRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getCalendarEventRepository(): CCalendarEventRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getExtraFieldOptionsRepository(): ExtraFieldOptionsRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getQuestionRepository(): CQuizQuestionRepository
- Exclude checks
Missing function doc comment Open
Open
public static function setLegacyServices(ContainerInterface $container): void
- Exclude checks
Missing function doc comment Open
Open
public static function getLpItemRepository(): CLpItemRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getShortcutRepository(): CShortcutRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getStudentPublicationRepository(): CStudentPublicationRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getSequenceRepository(): SequenceRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getForumThreadRepository(): CForumThreadRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getMessageAttachmentRepository(): MessageAttachmentRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getPromotionRepository(): PromotionRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getWikiRepository(): CWikiRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getMailer(): Mailer
- Exclude checks
Missing function doc comment Open
Open
public static function getResourceNodeRepository(): ResourceNodeRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getCourseDescriptionRepository(): CCourseDescriptionRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getDocumentRepository(): CDocumentRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getExternalToolRepository(): ExternalToolRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getIllustrationRepository(): IllustrationRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getStudentPublicationAssignmentRepository(): CStudentPublicationAssignmentRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getSettingsManager(): SettingsManager
- Exclude checks
Missing function doc comment Open
Open
public static function getLanguageRepository(): LanguageRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getSurveyInvitationRepository(): CSurveyInvitationRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getToolIntroRepository(): CToolIntroRepository
- Exclude checks
Missing function doc comment Open
Open
public static function getFormFactory(): FormFactory
- Exclude checks
Missing function doc comment Open
Open
public static function getRouter(): Router
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
Open
default => 'info',
- Exclude checks
Space before opening parenthesis of function call prohibited Open
Open
$type = match ($type) {
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
Open
$session->getFlashBag()->add($type, $message);
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
Open
if ($session instanceof Session) {
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
Open
$session = self::getSession();
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
Open
}
- Exclude checks