Monadic Doctrine repositories helper classes and services.

Overview

Latest Stable Version GitHub stars Total Downloads Type Coverage License Donate!

Doctrine Repository Monadic Helper

Description

This project provides the necessary classes and services to use Doctrine repositories in a more functional way, by using monads.

This project also demonstrate that it's a nice and clean way to work with repositories and non-deterministic data store, in this case, a database.

There is no need to always check for the existence of an entity, so we are able to reduce the amount of conditions and cruft, while focusing on what's important and relevant only.

When using properly typed monads and callbacks, types inconsistencies will be instantly detected by static analysis tools. This provides a safer and better way to design functions and data transformation methods.

The monad in use in this project is the Either monad, provided by the contrib package Lamphpda from Marco Perone.

Installation

composer require loophp/repository-monadic-helper

Usage

To use this package and use monadic repositories, you can choose between 3 different ways:

  • Without alteration of existing repositories
    • By using an independent service which is creating a monadic repository from an entity class name or an existing repository.
  • With alteration of existing repositories
    • Upgrade repositories with an interface and a trait and add relevant typing information like: @implements MonadicServiceEntityRepositoryInterface<EntityClassName>
    • Replace extends ServiceEntityRepository with extends MonadicServiceEntityRepository and add relevant typing information like: @extends MonadicServiceEntityRepository<EntityClassName>

According to me, the best way to use this package is to use the first option.

By using a dedicated service

<?php

declare(strict_types=1);

namespace App\Controller;

use App\Entity\MyCustomEntity;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use Throwable;

final class MyCustomController
{
    public function __invoke(
        MonadicStandardRepositoryFactoryInterface $monadicStandardRepositoryFactory
    ) {
        $body = $monadicStandardRepositoryFactory
            ->fromEntity(MyCustomEntity::class);
            ->find(123) // This returns a Either monad.
            ->map(
                static fn (MyCustomEntity $entity): string => $entity->getTitle()
            )
            ->eval(
                static fn (Throwable $exception): string => $exception->getMessage(),
                static fn (string $entity): string => $entity
            );

        return new Response($body);
    }
}

By altering existing Doctrine repositories

Upgrade your Doctrine repositories from:

<?php

declare(strict_types=1);

namespace App\Repository;

use App\Entity\MyCustomEntity;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;

/**
 * @method MyCustomEntity|null find($id, $lockMode = null, $lockVersion = null)
 * @method MyCustomEntity|null findOneBy(array $criteria, array $orderBy = null)
 * @method MyCustomEntity[]    findAll()
 * @method MyCustomEntity[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
 */
class MyCustomEntityRepository extends ServiceEntityRepository
{
    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, MyCustomEntity::class);
    }
}

To:

<?php

declare(strict_types=1);

namespace App\Repository;

use App\Entity\MyCustomEntity;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use loophp\RepositoryMonadicHelper\MonadicServiceEntityRepository;
use Throwable;

/**
 * @extends MonadicServiceEntityRepository<MyCustomEntity>
 */
class MyCustomEntityRepository extends MonadicServiceEntityRepository
{
    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, MyCustomEntity::class);
    }
}

Update the way you're using Repositories from:

<?php

declare(strict_types=1);

namespace App\Controller;

use App\Entity\MyCustomEntity;
use App\Repository\MyCustomEntityRepository;
use Symfony\Component\HttpFoundation\Response;

final class MyCustomController
{
    public function __invoke(MyCustomEntityRepository $myCustomEntityRepository): Response
    {
        $id = /* Whatever value */;

        /** @var null|MyCustomEntity $myCustomEntity */
        $myCustomEntity = $myCustomEntityRepository->find($id);

        if ($myCustomEntity === null) {
            return new Response('No entity found with such ID.'),
        }

        return new Response(sprintf('Entity ID found, title: %s', $myCustomEntity->getTitle()))
    }
}

To:

<?php

declare(strict_types=1);

namespace App\Controller;

use App\Entity\MyCustomEntity;
use App\Repository\MyCustomEntityRepository;
use Symfony\Component\HttpFoundation\Response;
use Throwable;

final class MyCustomController
{
    public function __invoke(MyCustomEntityRepository $myCustomEntityRepository): Response
    {
        $id = /* Whatever value */;

        $responseBody = $myCustomEntityRepository
            ->eitherFind($id)
            ->eval(
                fn (Throwable $exception): string => $exception->getMessage(),
                fn (MyCustomEntity $myCustomEntity): string =>
                    sprintf('Entity ID found, title: %s', $myCustomEntity->getTitle())
            );

        return new Response($responseBody);
    }
}

Todo

  • Get rid of PHPStan baseline as soon as this PR is released,
  • Improve documentation and code examples.

Contributing

Feel free to contribute by sending Github pull requests. I'm quite responsive :-)

If you can't contribute to the code, you can also sponsor me on Github.

Changelog

See CHANGELOG.md for a changelog based on git commits.

For more detailed changelogs, please check the release changelogs.

Comments
  • build(deps): Bump actions/stale from 5 to 6

    build(deps): Bump actions/stale from 5 to 6

    Bumps actions/stale from 5 to 6.

    Release notes

    Sourced from actions/stale's releases.

    v6.0.0

    :warning: Breaking change :warning:

    Issues/PRs default close-issue-reason is now not_planned(#789)

    V5.2.0

    Features: New option include-only-assigned enables users to process only issues/PRs that are already assigned. If there is no assignees and this option is set, issue will not be processed per: issue/596

    Fixes: Fix date comparison edge case PR/816

    Dependency Updates: PR/812

    Fix issue when days-before-close is more than days-before-stale

    fixes a bug introduced in #717

    fixed in #775

    v5.1.0

    [5.1.0]

    Don't process stale issues right after they're marked stale Add close-issue-reason option #764#772 Various dependabot/dependency updates

    Changelog

    Sourced from actions/stale's changelog.

    Changelog

    [6.0.0]

    :warning: Breaking change :warning:

    Issues/PRs default close-issue-reason is now not_planned(#789)

    [5.1.0]

    Don't process stale issues right after they're marked stale [Add close-issue-reason option]#764#772 Various dependabot/dependency updates

    4.1.0 (2021-07-14)

    Features

    4.0.0 (2021-07-14)

    Features

    Bug Fixes

    • dry-run: forbid mutations in dry-run (#500) (f1017f3), closes #499
    • logs: coloured logs (#465) (5fbbfba)
    • operations: fail fast the current batch to respect the operations limit (#474) (5f6f311), closes #466
    • label comparison: make label comparison case insensitive #517, closes #516
    • filtering comments by actor could have strange behavior: "stale" comments are now detected based on if the message is the stale message not who made the comment(#519), fixes #441, #509, #518

    Breaking Changes

    • The options skip-stale-issue-message and skip-stale-pr-message were removed. Instead, setting the options stale-issue-message and stale-pr-message will be enough to let the stale workflow add a comment. If the options are unset, a comment will not be added which was the equivalent of setting skip-stale-issue-message to true.
    • The operations-per-run option will be more effective. After migrating, you could face a failed-fast process workflow if you let the default value (30) or set it to a small number. In that case, you will see a warning at the end of the logs (if enabled) indicating that the workflow was stopped sooner to avoid consuming too much API calls. In most cases, you can just increase this limit to make sure to process everything in a single run.
    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 stale github_actions 
    opened by dependabot[bot] 2
  • build(deps): Bump shivammathur/setup-php from 2.18.1 to 2.21.2

    build(deps): Bump shivammathur/setup-php from 2.18.1 to 2.21.2

    Bumps shivammathur/setup-php from 2.18.1 to 2.21.2.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.21.2

    Support Ukraine


    • Added support for rector in tools input. #627
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: `8.1`
        tools: rector
    
    • Added support for ast extension on macOS using shivammathur/extensions tap.
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: `8.1`
        extensions: ast
    
    • Fixed support for symfony-cli on Linux #632
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: `8.1`
        tools: symfony
    
    • Fixed installing unstable extensions from PECL. #625
    • Updated Node.js dependencies.

    2.21.1

    Support Ukraine

    ... (truncated)

    Commits
    • e04e1d9 Bump Node.js dependencies
    • 52685a3 Add support to install rector in tools input
    • 44d81f9 Fix symfony support
    • 401bdec Add support for ast from shivammathur/extensions on macOS
    • aa82ffc Fix logs in add_pecl_extension
    • 7e03c76 Fix extension setup using PECL on Linux and macOS
    • 16011a7 Upgrade Node.js dependencies
    • 66f2447 Fix reading composer package type for older versions
    • e57ea71 Fix scoped tool setup on Windows
    • e8ba27f Fail on npm audit again
    • Additional commits viewable in compare view

    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 stale 
    opened by dependabot[bot] 2
  • build(deps): Bump shivammathur/setup-php from 2.18.1 to 2.21.1

    build(deps): Bump shivammathur/setup-php from 2.18.1 to 2.21.1

    Bumps shivammathur/setup-php from 2.18.1 to 2.21.1.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.21.1

    Support Ukraine


    • Fixed installing tools' old versions which are composer plugins.

    • Updated Node.js dependencies.


    2.21.0

    Support Ukraine


    • Added support for Laravel Pint #613, #614
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: `8.1`
        tools: pint
    
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: `8.1`
        extensions: phalcon5
    
    • Added support for Private Packagist authentication for composer. Docs

    ... (truncated)

    Commits
    • 16011a7 Upgrade Node.js dependencies
    • 66f2447 Fix reading composer package type for older versions
    • e57ea71 Fix scoped tool setup on Windows
    • e8ba27f Fail on npm audit again
    • 945c34c Update README
    • c8c64c6 Bump version to 2.21.0
    • 0d3f92f Add support for phalcon5 on Windows
    • 4979d5b Add workaround for missing phalcon packages on Ubuntu 22.04
    • 0d9a1ba Add support for phalcon5 on Linux and macOS
    • 3ede765 Add check for gd in php.yml
    • Additional commits viewable in compare view

    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 stale 
    opened by dependabot[bot] 2
  • build(deps): Bump shivammathur/setup-php from 2.18.1 to 2.21.0

    build(deps): Bump shivammathur/setup-php from 2.18.1 to 2.21.0

    Bumps shivammathur/setup-php from 2.18.1 to 2.21.0.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.21.0

    Support Ukraine


    • Added support for Laravel Pint #613, #614
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: `8.1`
        tools: pint
    
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: `8.1`
        extensions: phalcon5
    
    • Added support for Private Packagist authentication for composer. Docs
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.1'
      env:
        PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }}
    
    • Added support for manual JSON-based authentication for composer Docs
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.1'
      env:
        COMPOSER_AUTH_JSON: |
          {
            "http-basic": {
              "example.org": {
    </tr></table> 
    

    ... (truncated)

    Commits
    • 945c34c Update README
    • c8c64c6 Bump version to 2.21.0
    • 0d3f92f Add support for phalcon5 on Windows
    • 4979d5b Add workaround for missing phalcon packages on Ubuntu 22.04
    • 0d9a1ba Add support for phalcon5 on Linux and macOS
    • 3ede765 Add check for gd in php.yml
    • f3cdc07 Merge pull request #617 from ChristophWurst/demo/php82-gd
    • 109db64 Demo PHP8.2+gd failure
    • 3ccc00e Merge pull request #614 from d8vjork/master
    • 0f688a1 Add support for tool Laravel Pint
    • Additional commits viewable in compare view

    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 stale 
    opened by dependabot[bot] 2
  • build(deps): Bump shivammathur/setup-php from 2.18.1 to 2.20.1

    build(deps): Bump shivammathur/setup-php from 2.18.1 to 2.20.1

    Bumps shivammathur/setup-php from 2.18.1 to 2.20.1.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.20.1

    Support Ukraine



    2.20.0

    Support Ukraine


    • Improved support for event extension on Linux and macOS for PHP 5.4 and above. #604

    • Fixed support for composer plugins in tools input. Since composer 2.2, the plugins are required to be marked as allowed in the composer config. This will now be done by default. #611

    • Added support to show code coverage driver's (Xdebug/PCOV) version in the logs when setup using the coverage input. #610

    • Fixed a bug where PHP was not added to PATH during the action run on self-hosted Windows environments. #609

    • Fixed a bug where the tool cache path was not set on self-hosted environments. #606

    • Updated Node.js dependencies.


    Thanks! @​jrfnl, @​dino182 and @​markseuffert for the contributions πŸš€

    ... (truncated)

    Commits
    • 3312ea6 Bump version to 2.20.1
    • ce49f82 Do not add composer plugins to allow list for composer v1
    • cf5cd90 Improve support for composer authenticating private respositories
    • cdb037c Bump version to 2.20.0
    • 261f13a Add composer plugins to allow list before installing
    • 9eaa66d Add support for event extension on unix
    • da9dfe4 Set RUNNER_TOOL_CACHE on self-hosted environments
    • a863ab6 Add support to allow composer plugins
    • 050cb80 Add coverage driver version in logs
    • 3fda17f Merge pull request #609 from dino182/develop
    • Additional commits viewable in compare view

    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 stale 
    opened by dependabot[bot] 2
  • build(deps): Bump shivammathur/setup-php from 2.18.1 to 2.19.1

    build(deps): Bump shivammathur/setup-php from 2.18.1 to 2.19.1

    Bumps shivammathur/setup-php from 2.18.1 to 2.19.1.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.19.1

    Support Ukraine


    • Fixed support for deployer.

    • Updated Node.js dependencies.


    2.19.0

    Support Ukraine


    • Added support for ubuntu-22.04 runner. Docs

    • Added support for Couchbase extension 4.x for PHP 7.4 and above. Also added support to specify the extension version you need. shivammathur/setup-php#593

      Note: Please use the extensions cache if using the latest Couchbase version on Linux as it can take 10+ minutes to build along with its library.

      To install the latest version of couchbase extension

      - name: Setup PHP
        uses: shivammathur@setup-php@v2
        with:
          php-version: '8.1'
          extensions: couchbase
      

      To install a specific version - suffix couchbase with exact version you want in the extensions input.

      - name: Setup PHP
        uses: shivammathur@setup-php@v2
        with:
          php-version: '7.4'
      

    ... (truncated)

    Commits
    • 3eda583 Bump version to 2.19.1
    • 74d43be Fix support for deployer
    • aa1fe47 Bump version to 2.19.0
    • a92acf1 Remove years from LICENSE
    • 0533892 Fix jsdoc in fetch.ts
    • 43fb4ad Bump ES version to 2021
    • b88a8c8 Fix protoc support
    • 36d7f6c Set target-branch to develop in dependabot.yml
    • a1a52db Merge pull request #598 from shivammathur/dependabot/github_actions/codecov/c...
    • 88e54b1 Merge pull request #599 from shivammathur/dependabot/github_actions/github/co...
    • Additional commits viewable in compare view

    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 stale 
    opened by dependabot[bot] 2
  • build(deps): Bump shivammathur/setup-php from 2.18.1 to 2.19.0

    build(deps): Bump shivammathur/setup-php from 2.18.1 to 2.19.0

    Bumps shivammathur/setup-php from 2.18.1 to 2.19.0.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.19.0

    Support Ukraine


    • Added support for ubuntu-22.04 runner. Docs

    • Added support for Couchbase extension 4.x for PHP 7.4 and above. Also added support to specify the extension version you need. shivammathur/setup-php#593

      Note: Please use the extensions cache if using the latest Couchbase version on Linux as it can take 10+ minutes to build along with its library.

      To install the latest version of couchbase extension

      - name: Setup PHP
        uses: shivammathur@setup-php@v2
        with:
          php-version: '8.1'
          extensions: couchbase
      

      To install a specific version - suffix couchbase with exact version you want in the extensions input.

      - name: Setup PHP
        uses: shivammathur@setup-php@v2
        with:
          php-version: '7.4'
          extensions: couchbase-2.6.2
      
    • Improved fallback support upon cache failure in composer setup. This fixes an error when the latest composer version was installed on older PHP versions when fetching composer from shivammathur/composer-cache failed.

    • Bumped Node.js version required to 16.x. Also bumped build target version to ES2021.

    • Removed support for Debian 9 and Ubuntu 21.04 for self-hosted runners. Docs

    • Fixed tools setup with older composer versions which do not create composer.json if missing in the directory.

    • Fixed support for extensions on macOS where the extension package name might conflict with package names in homebrew-core repo. This fixes support for redis extension on macOS on PHP 7.0.

    • Fixed enabling cached extensions which depend on other extensions on PHP 7.1 and lower.

    • Fixed setting default INI values so that it is possible to override those using php -c. shivammathur/setup-php#595

    ... (truncated)

    Commits
    • aa1fe47 Bump version to 2.19.0
    • a92acf1 Remove years from LICENSE
    • 0533892 Fix jsdoc in fetch.ts
    • 43fb4ad Bump ES version to 2021
    • b88a8c8 Fix protoc support
    • 36d7f6c Set target-branch to develop in dependabot.yml
    • a1a52db Merge pull request #598 from shivammathur/dependabot/github_actions/codecov/c...
    • 88e54b1 Merge pull request #599 from shivammathur/dependabot/github_actions/github/co...
    • 203099e Merge pull request #600 from shivammathur/dependabot/github_actions/actions/s...
    • 4e9ea33 Bump actions/setup-node from 1 to 3
    • Additional commits viewable in compare view

    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 stale 
    opened by dependabot[bot] 2
  • build(deps): Bump actions/checkout from 2.4.0 to 3.0.1

    build(deps): Bump actions/checkout from 2.4.0 to 3.0.1

    Bumps actions/checkout from 2.4.0 to 3.0.1.

    Release notes

    Sourced from actions/checkout's releases.

    v3.0.1

    v3.0.0

    • Updated to the node16 runtime by default
      • This requires a minimum Actions Runner version of v2.285.0 to run, which is by default available in GHES 3.4 or later.

    v2.4.1

    • Fixed an issue where checkout failed to run in container jobs due to the new git setting safe.directory
    Changelog

    Sourced from actions/checkout's changelog.

    v3.0.1

    v3.0.0

    v2.3.1

    v2.3.0

    v2.2.0

    v2.1.1

    • Changes to support GHES (here and here)

    v2.1.0

    v2.0.0

    v2 (beta)

    • Improved fetch performance
      • The default behavior now fetches only the SHA being checked-out
    • Script authenticated git commands
      • Persists with.token in the local git config
      • Enables your scripts to run authenticated git commands
      • Post-job cleanup removes the token

    ... (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 stale 
    opened by dependabot[bot] 2
  • build(deps): Bump actions/checkout from 2.4.0 to 3

    build(deps): Bump actions/checkout from 2.4.0 to 3

    Bumps actions/checkout from 2.4.0 to 3.

    Release notes

    Sourced from actions/checkout's releases.

    v3.0.0

    • Update default runtime to node16
    Changelog

    Sourced from actions/checkout's changelog.

    Changelog

    v2.3.1

    v2.3.0

    v2.2.0

    v2.1.1

    • Changes to support GHES (here and here)

    v2.1.0

    v2.0.0

    v2 (beta)

    • Improved fetch performance
      • The default behavior now fetches only the SHA being checked-out
    • Script authenticated git commands
      • Persists with.token in the local git config
      • Enables your scripts to run authenticated git commands
      • Post-job cleanup removes the token
      • Coming soon: Opt out by setting with.persist-credentials to false
    • Creates a local branch
      • No longer detached HEAD when checking out a branch
      • A local branch is created with the corresponding upstream branch set
    • Improved layout

    ... (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 stale 
    opened by dependabot[bot] 2
  • chore(deps): update actions/stale action to v6

    chore(deps): update actions/stale action to v6

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | actions/stale | action | major | v5 -> v6 |


    Release Notes

    actions/stale

    v6

    Compare Source


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • composer.json (composer)
    • .github/workflows/code-style.yml (github-actions)
    • .github/workflows/prettier.yml (github-actions)
    • .github/workflows/prune.yaml (github-actions)
    • .github/workflows/release.yaml (github-actions)
    • .github/workflows/static-analysis.yml (github-actions)
    • .github/workflows/tests.yml (github-actions)

    Configuration Summary

    Based on the default config's presets, Renovate will:

    • Start dependency updates only once this onboarding PR is merged
    • Enable Renovate Dependency Dashboard creation.
    • If Renovate detects semantic commits, it will use semantic commit type fix for dependencies and chore for all others.
    • Ignore node_modules, bower_components, vendor and various test/tests directories.
    • Autodetect whether to pin dependencies or maintain ranges.
    • Rate limit PR creation to a maximum of two per hour.
    • Limit to maximum 10 open PRs at any time.
    • Group known monorepo packages together.
    • Use curated list of recommended non-monorepo package groupings.
    • A collection of workarounds for known problems with packages.

    πŸ”‘ Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


    What to Expect

    With your current configuration, Renovate will create 1 Pull Request:

    chore(deps): update actions/stale action to v6
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-stale-6.x
    • Merge into: main
    • Upgrade actions/stale to v6

    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • build(deps): Bump shivammathur/setup-php from 2.22.0 to 2.23.0

    build(deps): Bump shivammathur/setup-php from 2.22.0 to 2.23.0

    Bumps shivammathur/setup-php from 2.22.0 to 2.23.0.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.23.0

    Support Ukraine


    • Added support for nightly builds of PHP 8.3. Note: Specifying nightly as the php-version now will set up PHP 8.3.
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.3'
    
    • PHP 8.2 is now stable on setup-php. #673 Notes:
      • Specifying latest or 8.x as the php-version now will set up PHP 8.2.
      • Except ubuntu-22.04, all GitHub runners now have PHP 8.2 as the default version.
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.2'
    
    • Added support for thread-safe builds of PHP on Linux. #651
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.2'
      env:
        phpts: ts
    

    ... (truncated)

    Commits
    • 8e2ac35 Update README
    • a1e6789 Improve Get-PhalconReleaseAssetUrl
    • 9114b00 Restore stability workaround for PHP 8.1 on Windows
    • cb0c293 Fix typo in blackfire regex on Windows
    • 387ec95 Improve fetching phalcon release url on Windows
    • 3514d30 Allow major.minor protoc versions
    • e186e47 Bump version to 2.23.0
    • e51e662 Add support to install extensions from shivammathur/php-extensions-windows
    • 5afd8a1 Fix error in darwin.sh while updating dependencies
    • 1a42045 Use ls-remote to get default branch
    • Additional commits viewable in compare view

    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 stale github_actions 
    opened by dependabot[bot] 2
  • chore(deps): update shivammathur/setup-php action to v2.23.0

    chore(deps): update shivammathur/setup-php action to v2.23.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | shivammathur/setup-php | action | minor | 2.22.0 -> 2.23.0 |


    Release Notes

    shivammathur/setup-php

    v2.23.0

    Compare Source

    Support Ukraine

    #StandWithUkraine


    • Added support for nightly builds of PHP 8.3. Note: Specifying nightly as the php-version now will set up PHP 8.3.
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.3'
    
    • PHP 8.2 is now stable on setup-php. #​673 Notes:
      • Specifying latest or 8.x as the php-version now will set up PHP 8.2.
      • Except ubuntu-22.04, all GitHub runners now have PHP 8.2 as the default version.
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.2'
    
    • Added support for thread-safe builds of PHP on Linux. #​651
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.2'
      env:
        phpts: ts
    

    Full Changelog: https://github.com/shivammathur/setup-php/compare/2.22.0...2.23.0

    Merry Christmas and happy holidays! πŸŽ„πŸŽ

    Thanks! @​jrfnl and @​flavioheleno for the contributions πŸŽ‰

    Follow for updates

    setup-php reddit setup-php twitter setup-php status


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    stale 
    opened by renovate[bot] 2
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Open

    These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

    Detected dependencies

    composer
    composer.json
    • php >= 7.4
    • marcosh/lamphpda ^1
    • doctrine/doctrine-bundle ^2.6
    • doctrine/orm ^2.12
    • drupol/php-conventions ^5
    • phpspec/prophecy-phpunit ^2.0
    • phpunit/phpunit ^9.5
    github-actions
    .github/workflows/code-style.yml
    • actions/checkout v3
    • shivammathur/setup-php 2.22.0
    • ramsey/composer-install v2
    .github/workflows/prettier.yml
    • actions/checkout v3
    • cachix/install-nix-action v18
    .github/workflows/prune.yaml
    • actions/stale v7
    .github/workflows/release.yaml
    • actions/checkout v3
    • mindsers/changelog-reader-action v2
    • actions/create-release v1.1.4
    .github/workflows/static-analysis.yml
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install v2
    .github/workflows/tests.yml
    • actions/checkout v3
    • WyriHaximus/github-action-composer-php-versions-in-range v1
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install v2

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    stale 
    opened by renovate[bot] 5
Releases(1.0.9)
  • 1.0.9(Nov 16, 2022)

    Merged

    • chore(deps): update actions/stale action to v6 #27
    • Configure Renovate #26
    • build(deps): Bump shivammathur/setup-php from 2.18.1 to 2.22.0 #25
    • build(deps): Bump cachix/install-nix-action from 17 to 18 #24

    Commits

    Source code(tar.gz)
    Source code(zip)
  • 1.0.8(Aug 27, 2022)

  • 1.0.7(Aug 27, 2022)

  • 1.0.6(Jun 21, 2022)

  • 1.0.5(May 31, 2022)

  • 1.0.4(May 29, 2022)

  • 1.0.3(May 24, 2022)

    What's Changed

    • build(deps): Bump shivammathur/setup-php from 2.17.0 to 2.17.1 by @dependabot in https://github.com/loophp/repository-monadic-helper/pull/8
    • build(deps): Bump actions/cache from 2.1.7 to 3 by @dependabot in https://github.com/loophp/repository-monadic-helper/pull/9
    • build(deps): Bump shivammathur/setup-php from 2.17.1 to 2.18.0 by @dependabot in https://github.com/loophp/repository-monadic-helper/pull/10
    • build(deps): Bump actions/stale from 4 to 5 by @dependabot in https://github.com/loophp/repository-monadic-helper/pull/11
    • build(deps): Bump shivammathur/setup-php from 2.18.0 to 2.18.1 by @dependabot in https://github.com/loophp/repository-monadic-helper/pull/12
    • build(deps): Bump actions/checkout from 2.4.0 to 3.0.2 by @dependabot in https://github.com/loophp/repository-monadic-helper/pull/15

    Full Changelog: https://github.com/loophp/repository-monadic-helper/compare/1.0.2...1.0.3

    Source code(tar.gz)
    Source code(zip)
  • 1.0.2(Feb 12, 2022)

  • 1.0.1(Jan 9, 2022)

  • 1.0.0(Dec 9, 2021)

Owner
(infinite) loophp
(infinite) loophp
Laravel 5 - Repositories to abstract the database layer

Laravel 5 Repositories Laravel 5 Repositories is used to abstract the data layer, making our application more flexible to maintain. See versions: 1.0.

Anderson Andrade 4k Jan 6, 2023
A drop-in Doctrine ORM 2 implementation for Laravel 5+ and Lumen

Laravel Doctrine ORM A drop-in Doctrine ORM 2 implementation for Laravel 5+ $scientist = new Scientist( 'Albert', 'Einstein' ); $scientist->a

Laravel Doctrine 777 Dec 17, 2022
Doctrine Object Relational Mapper (ORM)

3.0.x 2.9.x 2.8.x Doctrine 2 is an object-relational mapper (ORM) for PHP 7.1+ that provides transparent persistence for PHP objects. It sits on top o

Doctrine 9.5k Jan 2, 2023
Spot v2.x DataMapper built on top of Doctrine's Database Abstraction Layer

Spot DataMapper ORM v2.0 Spot v2.x is built on the Doctrine DBAL, and targets PHP 5.4+. The aim of Spot is to be a lightweight DataMapper alternative

Spot ORM 602 Dec 27, 2022
:gem: Simple MySQLi Abstraction Layer + Doctrine/DBAL support

?? Simple MySQLi Class This is a simple MySQL Abstraction Layer compatible with PHP 7+ that provides a simple and secure interaction with your databas

Lars Moelleken 40 Sep 5, 2022
Doctrine Database Abstraction Layer

Doctrine DBAL 4.0-dev 3.0 2.13 N/A N/A Powerful database abstraction layer with many features for database schema introspection, schema management and

Doctrine 8.9k Dec 28, 2022
πŸ”Œ A Doctrine DBAL Driver implementation on top of Swoole Coroutine PostgreSQL extension

Swoole Coroutine PostgreSQL Doctrine DBAL Driver A Doctrine\DBAL\Driver implementation on top of Swoole\Coroutine\PostgreSQL. Getting started Install

Leo Cavalcante 19 Nov 25, 2022
Psalm Stubs for doctrine/mongodb-odm library

doctrine-mongodb-psalm-plugin A Doctrine plugin for Psalm (requires Psalm v4). Installation: $ composer require --dev runtothefather/doctrine-mongodb-

Evgeny 6 Jun 15, 2022
Provides integration for Doctrine with various Symfony components.

Doctrine Bridge The Doctrine bridge provides integration for Doctrine with various Symfony components. Resources Contributing Report issues and send P

Symfony 3k Dec 23, 2022
Doctrine PHP mapping driver

WORK IN PROGRESS! Doctrine PHP mapping driver Alternative mapping driver that allows to write mappings in PHP. Documentation Associations examples TOD

Andrey Klimenko 3 Aug 15, 2021
Doctrine extension to persist spatial data objects.

doctrine-Spatial Doctrine-spatial is a doctrine extension. It implements spatial types and functions. As exemple, this extension can help you to know

LongitudeOne 36 Jan 7, 2023
PostgreSQL enhancements for Doctrine

PostgreSQL enhancements for Doctrine. Provides support for advanced data types (json, jssnb, arrays), text search, array operators and jsonb specific functions.

Martin Georgiev 258 Dec 31, 2022
Get MYSQL statement from query builder in laravel helper

Get MYSQL statement laravel This package allows to get mysql statement that query builder in laravel made it for debugging purposes. Basic usage Dump

Ahmed Helal 9 Jul 15, 2022
Simple MySQL library for PHP 5.4+ includes Query Builder, PDO Native functions, Helper functions for quick use.

Simple MySQL library for PHP 5.4+ includes Query Builder, PDO Native functions, Helper functions for quick use.

Kodols 9 Dec 22, 2022
TO DO LIST WITH LOGIN AND SIGN UP and LOGOUT using PHP and MySQL please do edit the _dbconnect.php before viewing the website.

TO-DO-LIST-WITH-LOGIN-AND-SIGN-UP TO DO LIST WITH LOGIN AND SIGN UP and LOGOUT using PHP and MySQL please do edit the _dbconnect.php before viewing th

Aniket Singh 2 Sep 28, 2021
MOP is a php query handling and manipulation library providing easy and reliable way to manipulate query and get result in a fastest way. ( WEBSITE VERSION )

Mysql Optimizer mysql optimizer also known as MOP is a php query handling and manipulation library providing easy and reliable way to manipulate query

null 3 Feb 14, 2022
phpMyFAQ - Open Source FAQ web application for PHP and MySQL, PostgreSQL and other databases

phpMyFAQ 3.1 What is phpMyFAQ? phpMyFAQ is a multilingual, completely database-driven FAQ-system. It supports various databases to store all data, PHP

Thorsten Rinne 547 Dec 27, 2022
A simple and extensible fixture loader for PHP 7.3+, supporting SQLite and MySQL

Flowder Flowder is a (really) simple fixture loader for PHP 7.3+, supporting SQLite and MySQL. Using Flowder in PHP 7.2 or below? Try version 1 instea

Joe Haines 6 Jan 17, 2021
Connect and work with MySQL/MariaDB database through MySQLi in PHP. This is an introductory project, If you need a simple and straightforward example that takes you straight to the point, you can check out these examples.

First MySQLi PHP Connect and work with MySQL/MariaDB database through MySQLi in PHP. The above exercises are designed for students. This is an introdu

Max Base 4 Feb 22, 2022