Skip to content

Commit 0dc547d

Browse files
committed
feature #32446 [Lock] rename and deprecate Factory into LockFactory (Simperfit)
This PR was merged into the 4.4 branch. Discussion ---------- [Lock] rename and deprecate Factory into LockFactory | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | yes<!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | none <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against branch 4.4. - Legacy code removals go to the master branch. --> As highlighted in symfony/symfony#32198 (review) we need to rename the factory to LockFactory for consistency and readability. Commits ------- fc75eb9bef [Lock] rename and deprecate Factory into LockFactory
2 parents fe44134 + 9de2218 commit 0dc547d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Command/LockableTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
namespace Symfony\Component\Console\Command;
1313

1414
use Symfony\Component\Console\Exception\LogicException;
15-
use Symfony\Component\Lock\Factory;
1615
use Symfony\Component\Lock\Lock;
16+
use Symfony\Component\Lock\LockFactory;
1717
use Symfony\Component\Lock\Store\FlockStore;
1818
use Symfony\Component\Lock\Store\SemaphoreStore;
1919

@@ -48,7 +48,7 @@ private function lock($name = null, $blocking = false)
4848
$store = new FlockStore();
4949
}
5050

51-
$this->lock = (new Factory($store))->createLock($name ?: $this->getName());
51+
$this->lock = (new LockFactory($store))->createLock($name ?: $this->getName());
5252
if (!$this->lock->acquire($blocking)) {
5353
$this->lock = null;
5454

Tests/Command/LockableTraitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\Console\Tester\CommandTester;
16-
use Symfony\Component\Lock\Factory;
16+
use Symfony\Component\Lock\LockFactory;
1717
use Symfony\Component\Lock\Store\FlockStore;
1818
use Symfony\Component\Lock\Store\SemaphoreStore;
1919

@@ -47,7 +47,7 @@ public function testLockReturnsFalseIfAlreadyLockedByAnotherCommand()
4747
$store = new FlockStore();
4848
}
4949

50-
$lock = (new Factory($store))->createLock($command->getName());
50+
$lock = (new LockFactory($store))->createLock($command->getName());
5151
$lock->acquire();
5252

5353
$tester = new CommandTester($command);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy