Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
project
automatic_updates
Merge requests
!1002
Enable PHPUnit job for auto_updates and package_manager unit tests only
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Enable PHPUnit job for auto_updates and package_manager unit tests only
issue/automatic_updates-3409774:3409774-run-unit-tests
into
3.0.x
Overview
0
Commits
23
Pipelines
23
Changes
1
Merged
Adam G-H
requested to merge
issue/automatic_updates-3409774:3409774-run-unit-tests
into
3.0.x
1 year ago
Overview
0
Commits
23
Pipelines
23
Changes
2
Expand
Closes
#3409774
0
0
Merge request reports
Compare
version 21
version 21
57492e5d
1 year ago
version 20
454322b8
1 year ago
version 19
70d864f5
1 year ago
version 18
c3c377de
1 year ago
version 17
c01e66ed
1 year ago
version 16
4d664c4a
1 year ago
version 15
77fc28ff
1 year ago
version 14
f501e1c7
1 year ago
version 13
1c8dc936
1 year ago
version 12
ae585b72
1 year ago
version 11
d3984486
1 year ago
version 10
a89ff900
1 year ago
version 9
dbbdd37e
1 year ago
version 8
30a8923d
1 year ago
version 7
01436757
1 year ago
version 6
4ef9bc77
1 year ago
version 5
e01af752
1 year ago
version 4
b6140026
1 year ago
version 3
1e9ba6fc
1 year ago
version 2
8917d058
1 year ago
version 1
d76427cd
1 year ago
3.0.x (base)
and
latest version
latest version
35f2ae65
23 commits,
1 year ago
version 21
57492e5d
23 commits,
1 year ago
version 20
454322b8
22 commits,
1 year ago
version 19
70d864f5
20 commits,
1 year ago
version 18
c3c377de
19 commits,
1 year ago
version 17
c01e66ed
18 commits,
1 year ago
version 16
4d664c4a
17 commits,
1 year ago
version 15
77fc28ff
16 commits,
1 year ago
version 14
f501e1c7
15 commits,
1 year ago
version 13
1c8dc936
14 commits,
1 year ago
version 12
ae585b72
13 commits,
1 year ago
version 11
d3984486
12 commits,
1 year ago
version 10
a89ff900
11 commits,
1 year ago
version 9
dbbdd37e
9 commits,
1 year ago
version 8
30a8923d
8 commits,
1 year ago
version 7
01436757
7 commits,
1 year ago
version 6
4ef9bc77
6 commits,
1 year ago
version 5
e01af752
5 commits,
1 year ago
version 4
b6140026
4 commits,
1 year ago
version 3
1e9ba6fc
3 commits,
1 year ago
version 2
8917d058
2 commits,
1 year ago
version 1
d76427cd
1 commit,
1 year ago
Show latest version
2 files
+
53
−
17
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
package_manager/src/PackageManagerUninstallValidator.php
+
51
−
14
Options
@@ -4,15 +4,16 @@ declare(strict_types = 1);
namespace
Drupal\package_manager
;
use
Drupal\Component\Datetime\TimeInterface
;
use
Drupal\Core\Extension\ModuleUninstallValidatorInterface
;
use
Drupal\Core\Queue\QueueFactory
;
use
Drupal\Core\StringTranslation\StringTranslationTrait
;
use
Drupal\Core\TempStore\SharedTempStoreFactory
;
use
PhpTuf\ComposerStager\API\Core\BeginnerInterface
;
use
PhpTuf\ComposerStager\API\Core\CommitterInterface
;
use
PhpTuf\ComposerStager\API\Core\StagerInterface
;
use
PhpTuf\ComposerStager\API\Path\Factory\PathFactoryInterface
;
use
Symfony\Component\DependencyInjection\ContainerAwareInterface
;
use
Symfony\Component\DependencyInjection\ContainerAwareTrait
;
use
Symfony\Component\EventDispatcher\EventDispatcherInterface
;
/**
* Prevents any module from being uninstalled if update is in process.
@@ -22,26 +23,62 @@ use Symfony\Component\DependencyInjection\ContainerAwareTrait;
* at any time without warning. External code should not interact with this
* class.
*/
final
class
PackageManagerUninstallValidator
implements
ModuleUninstallValidatorInterface
,
ContainerAwareInterface
{
final
class
PackageManagerUninstallValidator
implements
ModuleUninstallValidatorInterface
{
use
ContainerAwareTrait
;
use
StringTranslationTrait
;
/**
* Constructs a new PackageManagerUninstallValidator object.
*
* @param \Drupal\package_manager\PathLocator $pathLocator
* The path locator service.
* @param \PhpTuf\ComposerStager\API\Core\BeginnerInterface $beginner
* The beginner service.
* @param \PhpTuf\ComposerStager\API\Core\StagerInterface $stager
* The stager service.
* @param \PhpTuf\ComposerStager\API\Core\CommitterInterface $committer
* The committer service.
* @param \Drupal\Core\Queue\QueueFactory $queueFactory
* The queue factory service.
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher
* The event dispatcher service.
* @param \Drupal\Core\TempStore\SharedTempStoreFactory $sharedTempStoreFactory
* The shared temp store factory service.
* @param \Drupal\Component\Datetime\TimeInterface $time
* The time service.
* @param \PhpTuf\ComposerStager\API\Path\Factory\PathFactoryInterface $pathFactory
* The path factory service.
* @param \Drupal\package_manager\FailureMarker $failureMarker
* The failure marker service.
*/
public
function
__construct
(
private
readonly
PathLocator
$pathLocator
,
private
readonly
BeginnerInterface
$beginner
,
private
readonly
StagerInterface
$stager
,
private
readonly
CommitterInterface
$committer
,
private
readonly
QueueFactory
$queueFactory
,
private
readonly
EventDispatcherInterface
$eventDispatcher
,
private
readonly
SharedTempStoreFactory
$sharedTempStoreFactory
,
private
readonly
TimeInterface
$time
,
private
readonly
PathFactoryInterface
$pathFactory
,
private
readonly
FailureMarker
$failureMarker
)
{}
/**
* {@inheritdoc}
*/
public
function
validate
(
$module
)
{
$stage
=
new
class
(
$this
->
container
->
get
(
P
athLocator
::
class
)
,
$this
->
container
->
get
(
BeginnerInterface
::
class
)
,
$this
->
container
->
get
(
StagerInterface
::
class
)
,
$this
->
co
ntainer
->
get
(
CommitterInterface
::
class
)
,
$this
->
container
->
get
(
Q
ueueFactory
::
class
)
,
$this
->
container
->
get
(
'
event
_d
ispatcher
'
)
,
$this
->
container
->
get
(
't
emp
s
tore
.shared'
)
,
$this
->
container
->
get
(
'datetime.time'
)
,
$this
->
container
->
get
(
PathFactoryInterface
::
class
)
,
$this
->
container
->
get
(
F
ailureMarker
::
class
)
)
extends
StageBase
{};
$this
->
p
athLocator
,
$this
->
beginner
,
$this
->
stager
,
$this
->
co
mmitter
,
$this
->
q
ueueFactory
,
$this
->
event
D
ispatcher
,
$this
->
sharedT
emp
S
tore
Factory
,
$this
->
time
,
$this
->
pathFactory
,
$this
->
f
ailureMarker
)
extends
StageBase
{};
if
(
$stage
->
isAvailable
()
||
!
$stage
->
isApplying
())
{
return
[];
}
Loading