File tree Expand file tree Collapse file tree 1 file changed +6
-19
lines changed
Expand file tree Collapse file tree 1 file changed +6
-19
lines changed Original file line number Diff line number Diff line change @@ -32,38 +32,25 @@ public function __construct(
3232 */
3333 public function vote (SiteaccessPreviewVoterContext $ context ): bool
3434 {
35- $ siteaccess = $ context ->getSiteaccess ();
35+ $ siteAccess = $ context ->getSiteaccess ();
3636 $ location = $ context ->getLocation ();
3737 $ languageCode = $ context ->getLanguageCode ();
38- $ contentLanguages = $ context ->getVersionInfo ()->languageCodes ;
3938
40- if (empty (array_intersect ($ this ->getRootLocationIds ($ siteaccess ), $ location ->path ))) {
39+ if (empty (array_intersect ($ this ->getRootLocationIds ($ siteAccess ), $ location ->path ))) {
4140 return false ;
4241 }
4342
44- if (!$ this ->validateRepositoryMatch ($ siteaccess )) {
43+ if (!$ this ->validateRepositoryMatch ($ siteAccess )) {
4544 return false ;
4645 }
4746
48- $ siteaccessLanguages = $ this ->configResolver ->getParameter (
47+ $ siteAccessLanguages = $ this ->configResolver ->getParameter (
4948 'languages ' ,
5049 null ,
51- $ siteaccess
50+ $ siteAccess
5251 );
5352
54- if (!in_array ($ languageCode , $ siteaccessLanguages , true )) {
55- return false ;
56- }
57-
58- $ primarySiteaccessLanguage = reset ($ siteaccessLanguages );
59- if (
60- $ languageCode !== $ primarySiteaccessLanguage
61- && in_array ($ primarySiteaccessLanguage , $ contentLanguages )
62- ) {
63- return false ;
64- }
65-
66- return true ;
53+ return in_array ($ languageCode , $ siteAccessLanguages , true );
6754 }
6855
6956 protected function validateRepositoryMatch (string $ siteaccess ): bool
You can’t perform that action at this time.
0 commit comments