Skip to content

Commit

Permalink
Merge branch 'feature/md-locker-factory' into 'master'
Browse files Browse the repository at this point in the history
Add LockerFactory

See merge request redbitcz/composer/utils!22
  • Loading branch information
Martin Dostál committed Nov 19, 2021
2 parents fd8af19 + 5f3ed4f commit d0abade
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Lock/LockerFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

namespace Redbitcz\Utils\Lock;


class LockerFactory
{
/** @var string */
private $dir;

public function __construct(string $dir)
{
$this->dir = $dir;
}

public function create(string $name, int $blockMode = Locker::NON_BLOCKING): Locker
{
return new Locker($this->dir, $name, $blockMode);
}
}

0 comments on commit d0abade

Please sign in to comment.