Code Duplication    Length = 17-17 lines in 5 locations

apps/files/lib/Activity/Provider.php 1 location

@@ 80-96 (lines=17) @@
77
	 * @throws \InvalidArgumentException
78
	 * @since 11.0.0
79
	 */
80
	public function parse($language, IEvent $event, IEvent $previousEvent = null) {
81
		if ($event->getApp() !== 'files') {
82
			throw new \InvalidArgumentException();
83
		}
84
85
		$this->l = $this->languageFactory->get('files', $language);
86
87
		if ($this->activityManager->isFormattingFilteredObject()) {
88
			try {
89
				return $this->parseShortVersion($event, $previousEvent);
90
			} catch (\InvalidArgumentException $e) {
91
				// Ignore and simply use the long version...
92
			}
93
		}
94
95
		return $this->parseLongVersion($event, $previousEvent);
96
	}
97
98
	/**
99
	 * @param IEvent $event

apps/systemtags/lib/Activity/Provider.php 1 location

@@ 81-97 (lines=17) @@
78
	 * @throws \InvalidArgumentException
79
	 * @since 11.0.0
80
	 */
81
	public function parse($language, IEvent $event, IEvent $previousEvent = null) {
82
		if ($event->getApp() !== 'systemtags') {
83
			throw new \InvalidArgumentException();
84
		}
85
86
		$this->l = $this->languageFactory->get('systemtags', $language);
87
88
		if ($this->activityManager->isFormattingFilteredObject()) {
89
			try {
90
				return $this->parseShortVersion($event);
91
			} catch (\InvalidArgumentException $e) {
92
				// Ignore and simply use the long version...
93
			}
94
		}
95
96
		return $this->parseLongVersion($event);
97
	}
98
99
	/**
100
	 * @param IEvent $event

apps/files/lib/Activity/FavoriteProvider.php 1 location

@@ 73-89 (lines=17) @@
70
	 * @throws \InvalidArgumentException
71
	 * @since 11.0.0
72
	 */
73
	public function parse($language, IEvent $event, IEvent $previousEvent = null) {
74
		if ($event->getApp() !== 'files' || $event->getType() !== 'favorite') {
75
			throw new \InvalidArgumentException();
76
		}
77
78
		$this->l = $this->languageFactory->get('files', $language);
79
80
		if ($this->activityManager->isFormattingFilteredObject()) {
81
			try {
82
				return $this->parseShortVersion($event);
83
			} catch (\InvalidArgumentException $e) {
84
				// Ignore and simply use the long version...
85
			}
86
		}
87
88
		return $this->parseLongVersion($event, $previousEvent);
89
	}
90
91
	/**
92
	 * @param IEvent $event

apps/files_sharing/lib/Activity/Providers/Base.php 1 location

@@ 74-90 (lines=17) @@
71
	 * @throws \InvalidArgumentException
72
	 * @since 11.0.0
73
	 */
74
	public function parse($language, IEvent $event, IEvent $previousEvent = null) {
75
		if ($event->getApp() !== 'files_sharing') {
76
			throw new \InvalidArgumentException();
77
		}
78
79
		$this->l = $this->languageFactory->get('files_sharing', $language);
80
81
		if ($this->activityManager->isFormattingFilteredObject()) {
82
			try {
83
				return $this->parseShortVersion($event);
84
			} catch (\InvalidArgumentException $e) {
85
				// Ignore and simply use the long version...
86
			}
87
		}
88
89
		return $this->parseLongVersion($event);
90
	}
91
92
	/**
93
	 * @param IEvent $event

apps/sharebymail/lib/Activity.php 1 location

@@ 87-103 (lines=17) @@
84
	 * @throws \InvalidArgumentException
85
	 * @since 11.0.0
86
	 */
87
	public function parse($language, IEvent $event, IEvent $previousEvent = null) {
88
		if ($event->getApp() !== 'sharebymail') {
89
			throw new \InvalidArgumentException();
90
		}
91
92
		$this->l = $this->languageFactory->get('sharebymail', $language);
93
94
		if ($this->activityManager->isFormattingFilteredObject()) {
95
			try {
96
				return $this->parseShortVersion($event);
97
			} catch (\InvalidArgumentException $e) {
98
				// Ignore and simply use the long version...
99
			}
100
		}
101
102
		return $this->parseLongVersion($event);
103
	}
104
105
	/**
106
	 * @param IEvent $event