Mutex lock implementation

Overview

Yii Mutex


Latest Stable Version Total Downloads Build status Scrutinizer Code Quality Code Coverage Mutation testing badge static analysis type-coverage

This package provides mutex implementation and allows mutual execution of concurrent processes in order to prevent "race conditions".

This is achieved by using a "lock" mechanism. Each possibly concurrent processes cooperates by acquiring a lock before accessing the corresponding data.

Requirements

  • PHP 7.4 or higher.

Installation

The package could be installed with composer:

composer require yiisoft/mutex --prefer-dist

Usage

There are multiple ways you can use the package. You can execute a callback in a synchronized mode i.e. only a single instance of the callback is executed at the same time:

/** @var \Yiisoft\Mutex\Synchronizer $synchronizer */
$newCount = $synchronizer->execute('critical', function () {
    return $counter->increase();
}, 10);

Another way is to manually open and close mutex:

/** @var \Yiisoft\Mutex\SimpleMutex $simpleMutex */
if (!$simpleMutex->acquire('critical', 10)) {
    throw new \RuntimeException('Unable to acquire mutex "critical".');
}
$newCount = $counter->increase();
$simpleMutex->release('critical');

It could be done on lower level:

/** @var \Yiisoft\Mutex\MutexFactoryInterface $mutexFactory */
$mutex = $mutexFactory->createAndAcquire('critical', 10);
$newCount = $counter->increase();
$mutex->release();

And if you want even more control, you can acquire mutex manually:

/** @var \Yiisoft\Mutex\MutexFactoryInterface $mutexFactory */
$mutex = $mutexFactory->create('critical');
if (!$mutex->acquire(10)) {
    throw new \RuntimeException('Unable to acquire mutex "critical".');
}
$newCount = $counter->increase();
$mutex->release();

Mutex drivers

There are some mutex drivers available as separate packages:

If you want to provide your own driver, you need to implement MutexFactoryInterface and MutexInterface. There is ready to extend Mutex, MutexFactory and a RetryAcquireTrait that contains retryAcquire() method implementing the "wait for a lock for a certain time" functionality.

When implementing your own drivers, you need to take care of automatic unlocking. For example using a destructor:

public function __destruct()
{
    $this->release();
}

and shutdown function:

public function __construct()
{
    register_shutdown_function(function () {
        $this->release();
    });
}

Note that you should not call the exit() or die() functions in the destructor or shutdown function. Since calling these functions in the destructor and shutdown function will prevent all subsequent completion functions from executing.

Testing

Unit testing

The package is tested with PHPUnit. To run tests:

./vendor/bin/phpunit

Mutation testing

The package tests are checked with Infection mutation framework with Infection Static Analysis Plugin. To run it:

./vendor/bin/roave-infection-static-analysis-plugin

Static analysis

The code is statically analyzed with Psalm. To run static analysis:

./vendor/bin/psalm

License

The Yii Mutex is free software. It is released under the terms of the BSD License. Please see LICENSE for more information.

Maintained by Yii Software.

Support the project

Open Collective

Follow updates

Official website Twitter Telegram Facebook Slack

Comments
  • Split specific drivers into their own packages

    Split specific drivers into their own packages

    opened by samdark 5
  • Update vimeo/psalm requirement from ^4.18 to ^5.2

    Update vimeo/psalm requirement from ^4.18 to ^5.2

    Updates the requirements on vimeo/psalm to permit the latest version.

    Release notes

    Sourced from vimeo/psalm's releases.

    5.2.0

    What's Changed

    Features

    Fixes

    Internal changes

    Typos

    New Contributors

    Full Changelog: https://github.com/vimeo/psalm/compare/5.1.0...5.2.0

    Commits
    • fb685a1 Merge pull request #8890 from weirdan/enum-forbidden-methods
    • 9db0eb3 InvalidEnumMethod requires PHP8.1+
    • 19a1005 Forbid most magic methods on enums
    • ca0b2a1 Merge pull request #8883 from weirdan/unused-messages-duplicates
    • 32eaf12 Prevent duplicate (Possibly)UnusedMethod/(Possibly)UnusedProperty
    • 114552f Merge pull request #8882 from theofidry/feature/update-cpu-core-counter
    • 4a6bfea Upgrade CpuCoreCounter
    • ef02ded Merge pull request #8833 from theofidry/feature/cpu-counter
    • af549fa Merge pull request #8854 from kkmuffme/fix-unsafe-file_get_contents
    • 2a45f18 Merge pull request #8870 from lptn/add-missing-sodium-functions
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 2
  • Update vimeo/psalm requirement from ^4.18 to ^5.1

    Update vimeo/psalm requirement from ^4.18 to ^5.1

    Updates the requirements on vimeo/psalm to permit the latest version.

    Release notes

    Sourced from vimeo/psalm's releases.

    5.1.0

    What's Changed

    Deprecations

    Features

    Fixes

    Docs

    New Contributors

    Full Changelog: https://github.com/vimeo/psalm/compare/5.0.0...5.1.0

    Commits
    • 4defa17 Merge pull request #8774 from bdsl/report-by-issue-type-severity
    • 1dbdf78 Code style fix
    • ad57727 Sort issue by position in codebase in ByIssueLevelAndTypeReport if level & ty...
    • a29f65e Fix too lax function visibility in test
    • 6693421 Code style fix
    • 5423983 Fix error in ByIssueLvelAndTypeReport heading
    • 699ee34 Indent heredoc in test
    • d6c7c86 Remove unecassary subheadings in error levels documentation
    • cd18cdc Re-order list of errors in docs
    • 9e63bf6 Minor code edits in ByIssueLevelAndType
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 2
  • Update vimeo/psalm requirement from ^4.18 to ^5.0

    Update vimeo/psalm requirement from ^4.18 to ^5.0

    Updates the requirements on vimeo/psalm to permit the latest version.

    Release notes

    Sourced from vimeo/psalm's releases.

    Psalm 5

    Welcome to Psalm 5!

    There's an accompanying post on psalm.dev, written by @​muglug & the current maintainers of Psalm.

    What's Changed

    Removed

    Features

    ... (truncated)

    Commits
    • 4e177bf Merge pull request #8790 from malarzm/patch-1
    • 7877570 Remove CallMapTest.php from Psalm self-analysis
    • 28188d1 Remove unfinished sentence
    • 6fff6df Merge pull request #8788 from weirdan/fix-xml-report-crashes-on-8.1
    • 874eb7d Fix crashes when XML report is used on PHP 8.1
    • 9d597cf Merge pull request #8782 from weirdan/check-runtime-requirements
    • 94dac9f Merge pull request #8783 from weirdan/bump-slevomat-coding-standard
    • ed36f2c Bump slevomat/coding-standard
    • 8fa35c2 Variables should outlive namespaces (#8779)
    • 05b8e0e Replace all references to static variables when moving class (#8780)
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 2
  • Throw of exception if retry delay less one millisecond

    Throw of exception if retry delay less one millisecond

    | Q | A | ------------- | --- | Is bugfix? | ❌ | New feature? | ❌ | Breaks BC? | ❌ | Fixed issues | -

    If you do not throw an InvalidArgumentException, it will be thrown:

    ValueError: usleep(): Argument #1 ($microseconds) must be greater than or equal to 0.
    
    status:code review 
    opened by devanych 2
  • Release mutex anyway despite autocommit option

    Release mutex anyway despite autocommit option

    Now every mutex driver must release mutex manually if option autocommit set on true.

    This decision not only adds difficulties in implementing the new driver, but also does not eliminate problems when managing the mutex.

    Imagine that you have some acquired mutex:

    $fileMutexFactory = new FileMutexFactory(__DIR__ . '/var/mutexes', false);
    
    $mutex = $this->mutexes->create('some_mutex');
    
    // some actions
    
    $this->doSomething(); // But there will be exception
    
    $mutex->release();
    

    Such mutex will not be released because autocommit turn off.

    I think, mutex releaser must be required and do not rely on the user's actions. Every mutex implementation must release mutex anyway in they destructor's.

    The following code will guarantees that the mutex will be released anyway on the script shutdown, and it also does not require drivers to implement it themselves.

    abstract class Mutex
    {
           /**
         * Acquires a lock.
         *
         * @param int $timeout Time (in seconds) to wait for lock to be released. Defaults to zero meaning that method
         * will return false immediately in case lock was already acquired.
         */
        abstract public function acquire(int $timeout = 0): bool;
    
        /**
         * Releases a lock.
         */
        abstract public function release(): void;
    
        abstract public function released(): bool;
    
        final public function __destruct()
        {
           if (!$this->released()) {
               $this->release();
           }
        }
    }
    

    After that, we can delete the call to the register_shutdown_function function and the `autocommit' option.

    opened by kafkiansky 2
  • Update vimeo/psalm requirement from ^4.18 to ^5.3

    Update vimeo/psalm requirement from ^4.18 to ^5.3

    Updates the requirements on vimeo/psalm to permit the latest version.

    Release notes

    Sourced from vimeo/psalm's releases.

    5.3.0

    What's Changed

    Features

    Fixes

    Docs

    Internal changes

    New Contributors

    Full Changelog: https://github.com/vimeo/psalm/compare/5.2.0...5.3.0

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 1
  • Bump actions/cache from 2 to 2.1.5

    Bump actions/cache from 2 to 2.1.5

    Bumps actions/cache from 2 to 2.1.5.

    Release notes

    Sourced from actions/cache's releases.

    v2.1.5

    • Fix permissions error seen when extracting caches with GNU tar that were previously created using BSD tar (actions/cache#527)

    v2.1.4

    • Make caching more verbose #650
    • Use GNU tar on macOS if available #701

    v2.1.3

    • Upgrades @actions/core to v1.2.6 for CVE-2020-15228. This action was not using the affected methods.
    • Fix error handling in uploadChunk where 400-level errors were not being detected and handled correctly

    v2.1.2

    • Adds input to limit the chunk upload size, useful for self-hosted runners with slower upload speeds
    • No-op when executing on GHES

    v2.1.1

    • Update @actions/cache package to v1.0.2 which allows cache action to use posix format when taring files.

    v2.1.0

    • Replaces the http-client with the Azure Storage SDK for NodeJS when downloading cache content from Azure. This should help improve download performance and reliability as the SDK downloads files in 4 MB chunks, which can be parallelized and retried independently
    • Display download progress and speed
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 1
  • Bump shivammathur/setup-php from 2 to 2.11.0

    Bump shivammathur/setup-php from 2 to 2.11.0

    Bumps shivammathur/setup-php from 2 to 2.11.0.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.11.0

    • Improve cache in shivammathur/php-ubuntu for PHP 5.6 to PHP 8.0. Using cache should reduce setup-php runtime on Ubuntu when the PHP version is not installed on the runner or update: true is set from 1-2 minutes to less than 5 seconds.

    • Add support to compile and install extensions from source from any git repository, from a sub-directory in a repository, with required libraries and configuration. Refer to this guide for more details and examples. #418, Closes #419

    • Add support to set up composer packages using tools input. Closes #442

    - name: Setup PHP with tools
      uses: shivammathur/setup-php@v2
      with:
        php-version: '7.4'
        tools: phpunit/phpunit
    
    • Add support to skip composer setup by specifying tools: none. Closes #446
    - name: Setup PHP with no tools using composer
      uses: shivammathur/setup-php@v2
      with:
        php-version: '7.4'
        tools: none
    
    • Add support for different ICU versions with PHP 8.1 on Ubuntu.
    - name: Setup PHP 8.1 with ICU 69.1
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.1'
        extensions: intl-69.1
    
    • Improve logs for compiling extensions from source. Now this process is verbose and the logs are grouped.
    • Improve extension support.
      • Add support for pdo_firebird.
      • Improve support for geos to compile on PHP 8.0 and 8.1.
      • Fix cubrid setup on Ubuntu 16.04.
      • Fix gearman support on Ubuntu.
      • Use GitHub releases for all couchbase versions.
      • Use shivammathur/extensions tap for apcu, phalcon, psr, memcache and memcached on macOS.
      • Fix phalcon3 on Windows.
      • Revert to ppa:ondrej/ppa for phalcon3 on Ubuntu.
      • Revert pcov patch for PHP 8 on Windows as the DLL is now available on PECL.
    • Add PHP commit hash in logs on PHP 8.1 (nightly) on Ubuntu. #433
    • Fix versions in logs of tools installed using composer.
    • Fix linking of old libraries on macOS.
    • Fix enabling cached extensions which have other extensions as dependencies. #428

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 1
  • Bump actions/cache from v2 to v2.1.4

    Bump actions/cache from v2 to v2.1.4

    Bumps actions/cache from v2 to v2.1.4.

    Release notes

    Sourced from actions/cache's releases.

    v2.1.4

    • Make caching more verbose #650
    • Use GNU tar on macOS if available #701
    Commits
    • 26968a0 Make save/restore logs akin (#509)
    • aeaf731 Use @actions/cache version 1.0.6 (#525)
    • 56a8a2f Merge pull request #514 from eregon/recommend-setup-ruby-bundler-cache
    • 1bfe3ac Recommend ruby/setup-ruby's bundler-cache: true option
    • 3543324 Merge pull request #434 from DanielHabenicht/patch-1
    • 3303695 Merge pull request #507 from odin-delrio/patch-1
    • e64ab30 Improved gradle cache key calculation example
    • 26c48dc Merge pull request #506 from actions/cache-matrix-example
    • 72f66cf Added a cache example when using matrix
    • 9f3a4d3 Merge pull request #443 from guilleijo/pipenv-example
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 1
  • Update vimeo/psalm requirement from ^4.1 to ^4.2

    Update vimeo/psalm requirement from ^4.1 to ^4.2

    Updates the requirements on vimeo/psalm to permit the latest version.

    Release notes

    Sourced from vimeo/psalm's releases.

    Add support for Github Security analysis

    Security analysis

    Support for sending analysis GitHub Security

    Thanks to @LukasReschke, Psalm can now output its results in a format compatible with GitHub's Code Scanning feature (#4582)

    More specific output for security issues

    Psalm now separates out different security issues it finds, with code snippets that reproduce the issue e.g. TaintedHtml and TaintedUnserialize

    Bugfixes

    Inheritance for docblock return and param types

    This ticket – #4537 – revealed a slight issue with Psalm's automatic inheritance of docblock param and return types.

    Psalm will now only inherit docblock parameter and return types from a single docblock, which means you can't define param types in one parent class method and return types in another. It's a relatively minor change, but it might break some code.

    Other bugfixes

    • Security Analysis: @LukasReschke made a lot of improvements to Psalm's taint analysis (#4554, #4572, #4576, #4592, #4604, #4630)
    • @pilif improved the mb_strtolower return type (#4469)
    • perform better inference for literal int division (#2132)
    • fix bugs caused by around ReflectionProperty stub not implementing Reflector (#4481)
    • better error message for PossiblyInvalidArrayOffset (#4479)
    • support assertions in new calls (#4491)
    • fix type inference when unpacking typed iterables (#4487)
    • @orklah added some undocumented properties to SoapFault (#4510)
    • @wouterj added support for reflecting builtin PHP union types (#4505)
    • autoloaded constants set in define are now inferred as mixed (#4509)
    • prevent crash with empty match expression (#4519)
    • treat exit expressions as the empty type (#4516)
    • track type contradiction issues in match expressions (#4517)
    • remember assignments when descending into property use (#4522)
    • @adrienlucas added support for proxying functions for taint analysis (#4495)
    • improve template param inference (#4485, #4524, #4545)
    • fix property initialisation checks when parent::__construct refers to grandparent class (#4540)
    • allow better get_class inference inside match expressions (#4544)
    • mark closure uses as UnusedVariable where possible (#4547)
    • prevent false-positive warning about calling unset on array with key (#4529)
    • @orklah added a check for accessing an array with a negative int offset (#4552)
    • @thomasvargiu fixed a bug intersecting with templated types (#4560)
    • @duskwuff added support for passing named arguments to functions that use variadic params (#4575)
    • added a more specific return type for substr in PHP 8 (#4580)
    • @BenMorel improved mysqli property types and a DateTimeInterface signature (#4577, #4579)
    • @mstilkerich added a more accurate stub for preg_filter (#4587)
    • improved a lot of tainting (#4599, #4605)
    • prevent negative line numbers in output (#4600)
    • prevent string literals from carrying taints (#4620)

    ... (truncated)

    Commits
    • ccf6e28 Grammar
    • 7c62b0c Make Readme more punchy
    • acb4bb4 documented type in InternalTaintSinkMap (#4627)
    • c562e1d Don’t taint foreach keys with array-fetch
    • e04f219 return static instead of self when static context detected (#4632)
    • 78d644d Change TaintedText to TaintedCallable
    • 4c315ec Closure calls aren’t sinks
    • 24fe7e5 Advertise SARIF export in the documentation (#4633)
    • 78f4a06 Add dedicated types for 'file', 'header' and 'cookie' (#4630)
    • 70c9fd9 Return empty instead of throwing
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 1
  • Allow microsecons (float?) as timeout

    Allow microsecons (float?) as timeout

    Good day. It not nessesery, but how about add microseconds as timeout - as additional argument or change current type to float? For example (my case) it can be used for some external API with limited requests per second. Thanks

    type:enhancement 
    opened by Gerych1984 0
Owner
Yii Software
Yii Framework and packages
Yii Software
Lock library to provide serialized execution of PHP code.

Requirements | Installation | Usage | License and authors | Donations php-lock/lock This library helps executing critical code in concurrent situation

null 875 Jan 7, 2023
PHP implementation of circuit breaker pattern.

What is php-circuit-breaker A component helping you gracefully handle outages and timeouts of external services (usually remote, 3rd party services).

ArturEjsmont 169 Jul 28, 2022
Implementation of the Token Bucket algorithm in PHP.

Token Bucket This is a threadsafe implementation of the Token Bucket algorithm in PHP. You can use a token bucket to limit an usage rate for a resourc

null 477 Jan 7, 2023
A PHP implementation of the Unleash protocol aka Feature Flags in GitLab.

A PHP implementation of the Unleash protocol aka Feature Flags in GitLab. This implementation conforms to the official Unleash standards and implement

Dominik Chrástecký 2 Aug 18, 2021
An implementation of the Minecraft: Bedrock Edition protocol in PHP

BedrockProtocol An implementation of the Minecraft: Bedrock Edition protocol in PHP This library implements all of the packets in the Minecraft: Bedro

PMMP 94 Jan 6, 2023
PHP Implementation of PASERK

PASERK (PHP) Platform Agnostic SERialized Keys. Requires PHP 7.1 or newer. PASERK Specification The PASERK Specification can be found in this reposito

Paragon Initiative Enterprises 9 Nov 22, 2022
Diff implementation

sebastian/diff Diff implementation for PHP, factored out of PHPUnit into a stand-alone component. Installation You can add this library as a local, pe

Sebastian Bergmann 7.2k Dec 29, 2022
A minimalistic implementation of Promises for PHP

libPromise A minimalistic implementation of Promises for PHP. Installation via DEVirion Install the DEVirion plugin and start your server. This will c

null 8 Sep 27, 2022
PHP's Promse implementation depends on the Swoole module.

php-promise-swoole PHP's Promse implementation depends on the Swoole module. Promise::allsettled([ /** Timer 调用 */ /** Timer call */

拓荒者 3 Mar 15, 2022
Pheature flags toggle CRUD implementation

Pheature Flags Toggle CRUD Pheature flags toggle CRUD implementation Installation Describe package installation composer require pheature/toggle-crud

Pheature Flags 5 Dec 14, 2022
A circular buffer implementation in PHP

Circular Buffer Installation ?? This is a great place for showing how to install the package, see below: Run $ composer require lctrs/circular-buffer

null 1 Jan 11, 2022
Frequently asked questions crud implementation for laravel projects

Laravel FAQs This is a simple package to help manage frequently asked questions in a project. Installation You can install the package via composer by

Detosphere Ltd 3 Jun 29, 2022
A simple laravel package for wallet implementation

wallet A simple laravel package for wallet implementation. This package can basically be plugged into a laravel project and it will handle wallet impl

Ademuyiwa Adetunji 8 Dec 1, 2022
My own implementation of the backend challenge.

Millions backend challenge My own implementation of the backend challenge. Implemented features Show posts paginated, and ordered by creation date wit

Mouad ZIANI 8 Jun 21, 2022
A Magento implementation for validating JSON Structures against a given Schema

Zepgram JsonSchema A Magento implementation for validating JSON Structures against a given Schema with support for Schemas of Draft-3 or Draft-4. Base

Benjamin Calef 1 Nov 5, 2021
This package contains a PHP implementation to solve 3D bin packing problems.

3D Bin Packager This package contains a PHP implementation to solve 3d bin packing problems based on gedex implementation on Go and enzoruiz implement

Farista Latuconsina 7 Nov 21, 2022
Pheature flags toggle model implementation

Pheature Flags Toggle Model implementation Pheature flags toggle model implementation Installation Describe package installation composer require phea

Pheature Flags 5 Dec 12, 2022
PHP implementation for reading and writing Apache Parquet files/streams

php-parquet This is the first parquet file format reader/writer implementation in PHP, based on the Thrift sources provided by the Apache Foundation.

null 17 Oct 25, 2022
A pure PHP implementation of the MessagePack serialization format / msgpack.org[PHP]

msgpack.php A pure PHP implementation of the MessagePack serialization format. Features Fully compliant with the latest MessagePack specification, inc

Eugene Leonovich 368 Dec 19, 2022