Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sg_youtube
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TYPO3
sg_youtube
Commits
8aec3335
Verified
Commit
8aec3335
authored
3 years ago
by
Kevin Ditscheid
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Fix rector issues
parent
8b0774c8
No related branches found
No related tags found
1 merge request
!6
TYPO3 11
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Classes/Service/YoutubeService.php
+11
-11
11 additions, 11 deletions
Classes/Service/YoutubeService.php
Configuration/TCA/Overrides/tt_content.php
+1
-1
1 addition, 1 deletion
Configuration/TCA/Overrides/tt_content.php
ext_localconf.php
+3
-3
3 additions, 3 deletions
ext_localconf.php
with
15 additions
and
15 deletions
Classes/Service/YoutubeService.php
+
11
−
11
View file @
8aec3335
...
...
@@ -40,13 +40,13 @@ use TYPO3\CMS\Core\Utility\VersionNumberUtility;
* YouTube Helper Service
*/
class
YoutubeService
{
const
API_URL
=
'https://www.googleapis.com/youtube/v3/'
;
const
API_CHANNEL
=
'search'
;
const
API_PLAYLIST
=
'playlistItems'
;
const
API_VIDEO
=
'videos'
;
const
API_PART
=
'snippet'
;
const
API_PART_LOCALIZATIONS
=
'localizations'
;
const
API_ORDER_BY
=
'date'
;
public
const
API_URL
=
'https://www.googleapis.com/youtube/v3/'
;
public
const
API_CHANNEL
=
'search'
;
public
const
API_PLAYLIST
=
'playlistItems'
;
public
const
API_VIDEO
=
'videos'
;
public
const
API_PART
=
'snippet'
;
public
const
API_PART_LOCALIZATIONS
=
'localizations'
;
public
const
API_ORDER_BY
=
'date'
;
/**
* Maps the json array from the YouTube call to return some unified value. The output from YouTube is pretty
...
...
@@ -158,7 +158,7 @@ class YoutubeService {
$localizationData
=
$this
->
getDetailedVideoInformationForJsonArray
(
$jsonArray
,
$apiKey
,
self
::
API_PART_LOCALIZATIONS
);
if
(
!
isset
(
$localizationData
[
'items'
])
||
count
(
$localizationData
[
'items'
])
<=
0
)
{
if
(
!
isset
(
$localizationData
[
'items'
])
||
(
is_countable
(
$localizationData
[
'items'
])
?
count
(
$localizationData
[
'items'
])
:
0
)
<=
0
)
{
return
$jsonArray
;
}
...
...
@@ -190,7 +190,7 @@ class YoutubeService {
}
foreach
(
$localizationData
[
'items'
]
as
$index
=>
$localizationEntry
)
{
if
(
!
isset
(
$localizationEntry
[
'localizations'
])
||
count
(
$localizationEntry
[
'localizations'
])
<=
0
)
{
if
(
!
isset
(
$localizationEntry
[
'localizations'
])
||
(
is_countable
(
$localizationEntry
[
'localizations'
])
?
count
(
$localizationEntry
[
'localizations'
])
:
0
)
<=
0
)
{
continue
;
}
...
...
@@ -266,7 +266,7 @@ class YoutubeService {
}
$result
=
$this
->
getJsonAsArray
(
''
,
'10'
,
$apiKey
,
$apiUrl
.
'?'
.
$query
);
if
(
!
isset
(
$result
[
'items'
])
||
count
(
$result
[
'items'
])
<=
0
)
{
if
(
!
isset
(
$result
[
'items'
])
||
(
is_countable
(
$result
[
'items'
])
?
count
(
$result
[
'items'
])
:
0
)
<=
0
)
{
return
$jsonArray
;
}
...
...
@@ -339,7 +339,7 @@ class YoutubeService {
throw
new
InvalidArgumentException
(
'No items array.'
,
403
);
}
if
(
count
(
$jsonArray
[
'items'
])
<
1
)
{
if
(
(
is_countable
(
$jsonArray
[
'items'
])
?
count
(
$jsonArray
[
'items'
])
:
0
)
<
1
)
{
throw
new
InvalidArgumentException
(
'No items found.'
,
403
);
}
...
...
This diff is collapsed.
Click to expand it.
Configuration/TCA/Overrides/tt_content.php
+
1
−
1
View file @
8aec3335
...
...
@@ -6,7 +6,7 @@ $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['sgyoutube_yo
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility
::
registerPlugin
(
'S
Galinski.sg_y
outube'
,
'S
rectorprefix20211231gY
outube'
,
'Youtube'
,
'YouTube Videos'
);
This diff is collapsed.
Click to expand it.
ext_localconf.php
+
3
−
3
View file @
8aec3335
...
...
@@ -24,15 +24,15 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
if
(
!
defined
(
'TYPO3
_MODE
'
))
{
if
(
!
defined
(
'TYPO3'
))
{
die
(
'Access denied.'
);
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility
::
configurePlugin
(
'S
Galinski.sg_y
outube'
,
'S
rectorprefix20211231gY
outube'
,
'Youtube'
,
[
'Youtube'
=>
'index'
,
\SGalinski\Srectorprefix20211231gYoutube\Controller\YoutubeController
::
class
=>
'index'
,
],
// non-cacheable actions
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment