Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simple_sitemap-3397160
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
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
Issue forks
simple_sitemap-3397160
Commits
81e5382b
Commit
81e5382b
authored
3 years ago
by
Pawel Ginalski
Browse files
Options
Downloads
Patches
Plain Diff
Attempt fixing PHP 8 tests
parent
d51f34fe
No related branches found
Branches containing commit
Tags
20160404_production
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/Entity/SimpleSitemap.php
+1
-1
1 addition, 1 deletion
src/Entity/SimpleSitemap.php
src/Entity/SimpleSitemapInterface.php
+1
-1
1 addition, 1 deletion
src/Entity/SimpleSitemapInterface.php
src/Entity/SimpleSitemapStorage.php
+7
-7
7 additions, 7 deletions
src/Entity/SimpleSitemapStorage.php
with
9 additions
and
9 deletions
src/Entity/SimpleSitemap.php
+
1
−
1
View file @
81e5382b
...
...
@@ -243,7 +243,7 @@ class SimpleSitemap extends ConfigEntityBase implements SimpleSitemapInterface {
return
$variant
;
}
public
static
function
purgeContent
(
$variants
=
NULL
,
$status
=
self
::
FETCH_BY_STATUS_PUBLISHED_UNPUBLISHED
)
{
public
static
function
purgeContent
(
$variants
=
NULL
,
?bool
$status
=
self
::
FETCH_BY_STATUS_PUBLISHED_UNPUBLISHED
)
{
\Drupal
::
entityTypeManager
()
->
getStorage
(
'simple_sitemap'
)
->
purgeContent
(
$variants
,
$status
);
}
...
...
This diff is collapsed.
Click to expand it.
src/Entity/SimpleSitemapInterface.php
+
1
−
1
View file @
81e5382b
...
...
@@ -44,5 +44,5 @@ interface SimpleSitemapInterface extends ConfigEntityInterface {
public
static
function
createOrUpdate
(
string
$id
,
string
$type
,
string
$label
=
NULL
,
int
$weight
=
0
):
SimpleSitemapInterface
;
public
static
function
purgeContent
(
$variants
=
NULL
,
$status
=
SimpleSitemap
::
FETCH_BY_STATUS_PUBLISHED_UNPUBLISHED
);
public
static
function
purgeContent
(
$variants
=
NULL
,
?bool
$status
=
SimpleSitemap
::
FETCH_BY_STATUS_PUBLISHED_UNPUBLISHED
);
}
This diff is collapsed.
Click to expand it.
src/Entity/SimpleSitemapStorage.php
+
7
−
7
View file @
81e5382b
...
...
@@ -207,7 +207,7 @@ class SimpleSitemapStorage extends ConfigEntityStorage {
->
execute
();
}
public
function
getChunkCount
(
SimpleSitemap
$entity
,
bool
$status
=
SimpleSitemap
::
FETCH_BY_STATUS_PUBLISHED_UNPUBLISHED
):
int
{
public
function
getChunkCount
(
SimpleSitemap
$entity
,
?
bool
$status
=
SimpleSitemap
::
FETCH_BY_STATUS_PUBLISHED_UNPUBLISHED
):
int
{
$query
=
$this
->
database
->
select
(
'simple_sitemap'
,
's'
)
->
condition
(
's.type'
,
$entity
->
id
())
->
condition
(
's.delta'
,
self
::
SITEMAP_INDEX_DELTA
,
'<>'
);
...
...
@@ -222,7 +222,7 @@ class SimpleSitemapStorage extends ConfigEntityStorage {
/**
* @todo Duplicate query.
*/
public
function
getChunk
(
SimpleSitemap
$entity
,
bool
$status
,
int
$delta
=
SimpleSitemapStorage
::
SITEMAP_CHUNK_FIRST_DELTA
):
string
{
public
function
getChunk
(
SimpleSitemap
$entity
,
?
bool
$status
,
int
$delta
=
SimpleSitemapStorage
::
SITEMAP_CHUNK_FIRST_DELTA
):
string
{
if
(
$delta
===
self
::
SITEMAP_INDEX_DELTA
)
{
throw
new
SitemapNotExistsException
(
'The sitemap chunk delta needs to be higher than 0.'
);
}
...
...
@@ -243,7 +243,7 @@ class SimpleSitemapStorage extends ConfigEntityStorage {
/**
* @todo Duplicate query.
*/
public
function
getIndex
(
SimpleSitemap
$entity
,
bool
$status
):
string
{
public
function
getIndex
(
SimpleSitemap
$entity
,
?
bool
$status
):
string
{
return
$this
->
getSitemapString
(
$entity
,
$this
->
getIdByDelta
(
$entity
,
self
::
SITEMAP_INDEX_DELTA
,
$status
),
$status
);
}
...
...
@@ -257,7 +257,7 @@ class SimpleSitemapStorage extends ConfigEntityStorage {
throw
new
SitemapNotExistsException
();
}
protected
function
getSitemapString
(
SimpleSitemap
$entity
,
int
$id
,
bool
$status
):
string
{
protected
function
getSitemapString
(
SimpleSitemap
$entity
,
int
$id
,
?
bool
$status
):
string
{
$chunk_data
=
$this
->
getChunkData
(
$entity
);
if
(
!
isset
(
$chunk_data
[
$id
]))
{
throw
new
SitemapNotExistsException
();
...
...
@@ -293,7 +293,7 @@ class SimpleSitemapStorage extends ConfigEntityStorage {
return
SimpleSitemap
::
SITEMAP_PUBLISHED_GENERATING
;
}
public
function
getCreated
(
SimpleSitemap
$entity
,
bool
$status
=
NULL
):
?string
{
public
function
getCreated
(
SimpleSitemap
$entity
,
?
bool
$status
=
SimpleSitemap
::
FETCH_BY_STATUS_PUBLISHED_UNPUBLISHED
):
?string
{
foreach
(
$this
->
getChunkData
(
$entity
)
as
$chunk
)
{
if
(
$status
===
SimpleSitemap
::
FETCH_BY_STATUS_PUBLISHED_UNPUBLISHED
||
$chunk
->
status
==
$status
)
{
return
$chunk
->
sitemap_created
;
...
...
@@ -303,7 +303,7 @@ class SimpleSitemapStorage extends ConfigEntityStorage {
return
NULL
;
}
public
function
getLinkCount
(
SimpleSitemap
$entity
,
bool
$status
=
NULL
):
int
{
public
function
getLinkCount
(
SimpleSitemap
$entity
,
?
bool
$status
=
SimpleSitemap
::
FETCH_BY_STATUS_PUBLISHED_UNPUBLISHED
):
int
{
$count
=
0
;
foreach
(
$this
->
getChunkData
(
$entity
)
as
$chunk
)
{
if
(
$chunk
->
delta
!=
self
::
SITEMAP_INDEX_DELTA
...
...
@@ -315,7 +315,7 @@ class SimpleSitemapStorage extends ConfigEntityStorage {
return
$count
;
}
public
function
purgeContent
(
$variants
=
NULL
,
$status
=
SimpleSitemap
::
FETCH_BY_STATUS_PUBLISHED_UNPUBLISHED
):
void
{
public
function
purgeContent
(
$variants
=
NULL
,
?bool
$status
=
SimpleSitemap
::
FETCH_BY_STATUS_PUBLISHED_UNPUBLISHED
):
void
{
$query
=
\Drupal
::
database
()
->
delete
(
'simple_sitemap'
);
if
(
$status
!==
SimpleSitemap
::
FETCH_BY_STATUS_PUBLISHED_UNPUBLISHED
)
{
$query
->
condition
(
'status'
,
$status
);
...
...
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