Giter Site home page Giter Site logo

snicco's Introduction

Snicco - Taking the pain out of enterprise WordPress development

codecov Psalm Type-Coverage Psalm level PhpMetrics - Static Analysis PHP-Versions

In this development monorepo you'll find many independent packages that will help you to develop testable, maintainable and PSR-compatible enterprise WordPress projects faster than ever before.

All packages in this repo are specifically designed to be usable in distributed WordPress code and are scopable out of the box.

Table of contents

  1. Repository Overview
    1. Component
    2. Bridge
    3. Middleware
    4. Bundle
    5. Testing
  2. Contributing
  3. Changelog
  4. Security
  5. License
  6. Credits

Repository Overview

You can find all packages in the src/Snicco directory.

Here is a brief overview of the repository: (hint: click the links to go to the dedicated documentation for each package)

Component

This directory contains completely decoupled PHP components that you can use in any WordPress (or any other PHP project) .

  • BetterWPAPI: A better way to interacts with WordPress core functions in distributed WordPress packages.
  • BetterWPCache: A PSR6/PSR16 implementation using the WP_Object_Cache. Supports cache tagging.
  • BetterWPCLI: The missing parts to the already awesome WP-CLI.
  • BetterWPHooks: The WordPress hook system redesign in 2022. (PSR-14 compliant)
  • BetterWPMail: The long overdue upgrade to the wp_mail function.
  • BetterWPDB: Keeps you safe and sane when working with custom tables in WordPress.
  • EventDispatcher: A general purpose, PSR-14 compliant event-dispatcher that powers snicco/better-wp-hooks.
  • HttpRouting: A blazing fast routing system and PSR7/PSR15 middleware dispatcher based on fast-route. Especially build for usage in legacy software where you don't have 100% control over the request-lifecycle.
  • Kernel: A minimal and customizable application bootstrapper.
  • Psr7ErrorHandler: A powerful, PSR-7/PSR-3 compliant error-handler.
  • Session: A custom session implementation for applications where $_SESSION can't be used for various reasons.
  • SignedURL: A standalone package to generate and validate protected urls.
  • StrArr: A zero-dependency,type-safe and psalm-compatible implementation of the illuminate/support string and array helpers.
  • Templating: A unified, immutable API for using and combining different template engines.
  • TestableClock: Helper classes for testing time-dependent code.

Bridge

This directory contains different implementations for interfaces defined in one of the components.

Middleware

This directory contains PSR15-Middleware that can be plugged into the snicco/http-routing component.

  • DefaultHeaders: Add custom headers to all outgoing responses.
  • HttpsOnly: Redirects HTTP => HTTPS for all requests
  • MethodOverride: Allows treating form submissions as PUT|PATCH|DELETE requests.
  • Negotiation: Performs content and language negotiation
  • NoRobots: Disallows search-engines to index the current request path.
  • Payload: Transforms JSON (and other) data to plain PHP arrays.
  • Redirect: Redirects requests to configured locations.
  • ShareCookies: Transforms cookie objects into response headers.
  • TrailingSlash: Redirects /foo/ to /foo or vice-versa.
  • WPAuthOnly: Grants access only to authenticated WordPress users.
  • WPCapability: Grants access only to WordPress users with the configured capability.
  • WPGuestsOnly: Grants access only to guest WordPress users.
  • WPNonce: Will solve all your WordPress Nonces problems once and for all.

Bundle

A bundle is a plugin for the snicco/kernel component and integrates one or more components or bridges to provide out of the box functionality.

While all components can absolutely be used without using the snicco/kernel component, bundles makes usage and configuration effortless.

Testing

This directory contains testing utilities for components. These packages are only meant to be used as development dependencies.

Contributing

We've set up a separate document for our contribution guidelines.

Changelog

Our changelog is automatically generated using the wonderful npm package semantic-release.

Security

Please review our security policy on how to securely report vulnerabilities.

License

This project is licensed under the terms of the GNU LGPLv3 unless otherwise specified in the respective LICENSE.md file of each package. See LICENSE.md

Credits

We want to express our special gratitude to:

snicco's People

Contributors

calvinalkan avatar snicco-bot avatar maluueu avatar vdwijngaert avatar

Stargazers

iamlos avatar Pär Thernström avatar Tanner Record avatar  avatar Atiq Samtia avatar Justin Foell avatar Rod Sot avatar Fadlul Alim avatar Rohan avatar Press Player avatar Susanto Effendi avatar Jacob Price avatar The Perfect Will avatar  avatar Marius Cristea avatar Yannik Preiß avatar Belakhdar Abdeldjalil avatar Jonathan Fretin avatar Vecsei Szilveszter avatar Nick Mathew avatar Chris W avatar Tom avatar Full Fat Joe avatar Kevin Firko avatar brendan avatar John Lee avatar NOKO avatar Oberon Lai avatar 琉見 avatar Huanyi Chuang (Eric) avatar 一介資男 avatar Luke Cavanagh avatar NetAgence avatar Nico Mollet avatar Eraville Steve avatar dabaaaz avatar Loïc Antignac avatar Jason Rouet avatar Nicolas Juen avatar Philipp Stracker avatar Ayman Rady avatar Zack Wallace avatar Brett Kelly avatar Jamie avatar Robert DeVore avatar Dibyajyoti Panda avatar Asad Abbas avatar Dan Knauss avatar rawsta avatar Christos Kavousanos avatar Stephen Feather avatar Wahyu Arief avatar Collins Agbonghama avatar Bowo avatar Rikhen avatar Dawid avatar Saiful Azfar Ramlee avatar Nawawi Jamili avatar  avatar Basilis Kanonidis avatar Damashe Thomas avatar Teemu Grönqvist avatar Chris Wathen avatar JFOC avatar Mike Hemberger avatar Mirco Babini avatar Bruno Pouliot avatar  avatar René Backhaus avatar Leonardo Losoviz avatar Michael Iseard avatar  avatar Michael Bourne avatar TotalBuzzKit avatar Andreas avatar Brandon Kramer avatar Alessandro Tesoro avatar mobber007 avatar Damien Chantelouve avatar R44CX avatar Will Woodlief avatar Sam Templeman avatar Radoš avatar  avatar  avatar Abdus Fauzi avatar chris montgomery avatar Brandon Hubbard avatar Luís Rodrigues avatar Sérgio Santos avatar Alexis Rouillard avatar Brian Schäffner avatar Zaher Ghaibeh avatar  avatar Vladimir Sklyar avatar Valerii Vasyliev avatar Clément Décou avatar Viktor Szépe avatar Maniruzzaman Akash avatar Yuhei Yasuda avatar

Watchers

Richard Aber avatar  avatar

snicco's Issues

[Bug]: select ... for share only work on mysql, nor mariadb

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

better-wpdb

Is this a regression?

No

Composer dependencies

//

Current behaviour

//

Expected behaviour

//

How to reproduce

wp db query "select * from wp_users where ID = 1 FOR SHARE"
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SHARE' at line 1

Possible solution

Use FOR LOCK IN SHARE MODE

Relevant log output

No response

Additional Context

No response

[Feature]: Update Bundles configuration method to use new afterConfiguration() event

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

monorepo

Description

Bundles like the TemplatingBundle should use the new afterConfiguration method offered by the Kernel.

Proposed solution

//

Alternatives

No response

[Feature]: Split VerifyWPNonce middleware into two seperate middleware

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

wp-nonce-middleware

Description

Currently, the VerifyWPNonce middleware handles two tasks.

  1. Validating nonces for unsafe request methods.
  2. Adding an instance of the nonce factory to view responses.

These two tasks should be split into separate middleware because currently is very painful to test Controllers if this middleware is applied globally as each request also needs to pass a valid nonce.

If the middleware is omitted for the tests, the views that use the WPNonce factory will throw exceptions because it was not added.

Proposed solution

//

Alternatives

//

feat(http-routing): allow matching admin pages by wildcards

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

http-routing

Description

Suppose we want to match multiple pages in the WP admin area like so:

$configurator->middleware(SomeMiddleware::class)->group(function (AdminRoutingConfigurator $configurator) {
        $configurator->page('plugins', '/plugins.php');
        $configurator->page('users', '/users.php');
        $configurator->page('user-new', '/user-new.php');
        $configurator->page('profile', '/profile.php');
    });

All of those pages have to be individual routes currently because we don't allow parameters in admin routes.

It would be good to allow the following:

$configurator->middleware(ConfirmSudoModeMiddleware::class)->group(function (AdminRoutingConfigurator $configurator) {
        $configurator->page('plugins', '/{path}')->requireOneOf(
            'path', ['users.php', 'profile.php', 'user-new.php', 'plugins.php']
        );
    });

Trying the above will currently throw a configuration exception.

// Snicco\Component\HttpRouting\Routing\RoutingConfigurator\Configurator.php

$this->validateThatDelegatedAttributesAreEmpty($name);

$this->validateThatNoAdminPrefixesAreSet($path, $name);

$route = $this->createRoute($name, $this->admin_dashboard_prefix->appendPath($path), ['GET'], $action);
$route->condition(IsAdminDashboardRequest::class);

$this->validateThatAdminRouteHasNoSegments($route);

Proposed solution

Allow admin routes to use wildcard and regex matching. I don't think that there is a functional requirement for this not to be available.

I think the only reason this guard was implemented is to prevent people from making mistakes during development.

Alternatives

No response

[Bug]: WPCLI commands are missing short description and long description

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

other/dont-know

Is this a regression?

No

Composer dependencies

//

Current behaviour

// WPCLIApplication.php

  ($add_command)($name, $callback, [
                'short_desc' => $command_class::shortDescription(),
                'long_desc' => $command_class::longDescription(),
                'synopsis' => $synopsis->toArray(),
                'when' => $command_class::when(),
            ]);

Expected behaviour

It should be shortdesc and longdesc

How to reproduce

Possible solution

No response

Relevant log output

No response

Additional Context

No response

chore(monorepo): add a rector rule to add psalm-internal annotations

It would be very convenient to have a custom rector rule that adds a @psalm-internal annotation for every class in a tests folder.
Besides that, the psalm-internal annotation should be added to all classes and methods where the native @interal docblock is already present

Determine best way to ship testing features that are only used as dev dependencies downstream.

Currently, all test-related features that downstream users can use are inside a /testing folder in the respective package.
The /testing folder is always added to .gitattributes which means it will not be downloaded when doing a production install of composer.
This means that these packages have to be installed with --prefer source in development if the testing features are desired.

There are three options for handling this.

  1. Add testing features inside /src/testing and exclude them from classmaps (This is how symfony does it)
  2. Add all testing features to a new repo. This would mean that ie. TestableEventDispatcher, FakeMailer etc. get their own packages. This seems like a bit too much tho.

[Bug]: HttpErrorHandlingOption::LOG_LEVELS configuration option does not allow interfaces

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

http-routing-bundle

Is this a regression?

No

Composer dependencies

//

Current behaviour

It's not possible to add the following http error handling configuration:

  HttpErrorHandlingOption::LOG_LEVELS => [
        Throwable::class => LogLevel::ERROR
    ],

You get the following exception message:

[Throwable] is not a valid exception class-string for http_error_handling.exception_log_levels

Expected behaviour

Interfaces should be allowed.

Anything that can be used in instanceOf should be ok

 private function determineLogLevel(Throwable $e, int $status_code): string
    {
        $user_defined_level = null;
        foreach ($this->log_levels as $type => $level) {
            if ($e instanceof $type) {
                $user_defined_level = $level;

                break;
            }
        }

        if ($user_defined_level) {
            return $user_defined_level;
        }

        return $status_code >= 500 ? LogLevel::CRITICAL : LogLevel::ERROR;
    }

How to reproduce

    // Code goes here

Possible solution

No response

Relevant log output

No response

Additional Context

No response

[Feature]: Make exclusion of stack traces customizable

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

minimal-logger

Description

Allow to exclude stack traces when logging exceptions with the minimal logger package

Proposed solution

//

Alternatives

No response

[Bug]: All test requests are API requests if no API prefix is set in config

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

testing-bundle

Is this a regression?

No

Composer dependencies

amphp/amp                              v2.6.2            A non-blocking concurrency framework for PHP applications.
amphp/byte-stream                      v1.8.1            A stream abstraction to make working with non-blocking ...
antecedent/patchwork                   2.1.21            Method redefinition (monkey-patching) functionality for...
behat/gherkin                          v4.9.0            Gherkin DSL parser for PHP
bjeavons/zxcvbn-php                    1.3.1             Realistic password strength estimation PHP library base...
bordoni/phpass                         0.3.5             Portable PHP password hashing framework
brick/math                             0.9.3             Arbitrary-precision arithmetic library
cache/simple-cache-bridge              1.2.0             A PSR-6 bridge to PSR-16. This will make any PSR-6 cach...
cache/tag-interop                      1.1.0             Framework interoperable interfaces for tags
cache/taggable-cache                   1.2.0             Add tag support to your PSR-6 cache implementation
codeception/codeception                4.1.x-dev e13382c BDD-style testing framework
codeception/lib-asserts                2.0.0             Assertion methods used by Codeception core and Asserts ...
codeception/module-cli                 1.1.1             Codeception module for testing basic shell commands and...
codeception/module-db                  1.2.0             DB module for Codeception
codeception/module-webdriver           1.4.0             WebDriver module for Codeception
codeception/phpunit-wrapper            9.0.9             PHPUnit classes used by Codeception
codeception/stub                       4.0.2             Flexible Stub wrapper for PHPUnit's Mock Builder
composer/ca-bundle                     1.3.1             Lets you find a path to the system CA bundle, and inclu...
composer/composer                      2.3.5             Composer helps you declare, manage and install dependen...
composer/metadata-minifier             1.0.0             Small utility library that handles metadata minificatio...
composer/package-versions-deprecated   1.11.99.5         Composer plugin that provides efficient querying for in...
composer/pcre                          3.0.0             PCRE wrapping library that offers type-safe preg_* repl...
composer/semver                        3.3.2             Semver library that offers utilities, version constrain...
composer/spdx-licenses                 1.5.7             SPDX licenses list and validation library.
composer/xdebug-handler                3.0.3             Restarts a process without Xdebug.
defuse/php-encryption                  v2.3.1            Secure PHP Encryption Library
dg/mysql-dump                          v1.5.1            MySQL database dump.
dnoegel/php-xdg-base-dir               v0.1.1            implementation of xdg base directory specification for php
doctrine/inflector                     2.0.4             PHP Doctrine Inflector is a small library that can perf...
doctrine/instantiator                  1.4.1             A small, lightweight utility to instantiate objects in ...
eftec/bladeone                         3.52              The standalone version Blade Template Engine from Larav...
felixfbecker/advanced-json-rpc         v3.2.1            A more advanced JSONRPC implementation
felixfbecker/language-server-protocol  v1.5.2            PHP classes for the Language Server Protocol
fidry/console                          0.4.0             Library to create CLI applications
filp/whoops                            2.14.5            php error handling for cool kids
gettext/gettext                        v4.8.6            PHP gettext manager
gettext/languages                      2.9.0             gettext languages with plural rules
graham-campbell/result-type            v1.0.4            An Implementation Of The Result Type
guzzlehttp/psr7                        2.2.1             PSR-7 message implementation that also provides common ...
humbug/php-scoper                      0.17.2            Prefixes all PHP namespaces in a file or directory.
illuminate/collections                 v8.83.13          The Illuminate Collections package.
illuminate/contracts                   v8.83.13          The Illuminate Contracts package.
illuminate/macroable                   v8.83.13          The Illuminate Macroable package.
illuminate/support                     v8.83.13          The Illuminate Support package.
jetbrains/phpstorm-stubs               v2021.3           PHP runtime & extensions header files for PhpStorm
justinrainbow/json-schema              5.2.12            A library to validate a json schema.
laminas/laminas-httphandlerrunner      2.1.0             Execute PSR-15 RequestHandlerInterface instances and em...
league/tactician                       v1.1.0            A small, flexible command bus. Handy for building servi...
league/tactician-logger                v0.11.0           Adds PSR-3 logging support to the Tactician command bus
lucatume/wp-browser                    3.1.6             WordPress extension of the PhpBrowser class.
mck89/peast                            v1.14.0           Peast is PHP library that generates AST for JavaScript ...
mikehaertl/php-shellcommand            1.6.4             An object oriented interface to shell commands
mikemclin/laravel-wp-password          2.0.3             Laravel package that checks and creates WordPress passw...
mustache/mustache                      v2.14.1           A Mustache implementation in PHP.
myclabs/deep-copy                      1.11.0            Create deep copies (clones) of your objects
nb/oxymel                              v0.1.0            A sweet XML builder
nesbot/carbon                          2.58.0            An API extension for DateTime that supports 281 differe...
netresearch/jsonmapper                 v4.0.0            Map nested JSON structures onto PHP classes
nette/neon                             v3.3.3            🍸 Nette NEON: encodes and decodes NEON file format.
nette/utils                            v3.2.7            🛠  Nette Utils: lightweight utilities for string & a...
nikic/fast-route                       v1.3.0            Fast request router for PHP
nikic/php-parser                       v4.13.2           A PHP parser written in PHP
nyholm/psr7                            1.5.0             A fast PHP7 implementation of PSR-7
nyholm/psr7-server                     1.0.2             Helper classes to handle PSR-7 server requests
openlss/lib-array2xml                  1.0.0             Array2XML conversion library credit to lalit.org
paragonie/constant_time_encoding       v2.5.0            Constant-time Implementations of RFC 4648 Encoding (Bas...
paragonie/password_lock                v3.1.0            Wraps Bcrypt-SHA2 in Authenticated Encryption
paragonie/random_compat                v9.99.100         PHP 5.x polyfill for random_bytes() and random_int() fr...
phar-io/manifest                       2.0.3             Component for reading phar.io manifest information from...
phar-io/version                        3.2.1             Library for handling version information and constraints
php-http/message-factory               v1.0.2            Factory interfaces for PSR-7 HTTP Message
php-stubs/wordpress-stubs              v5.9.3            WordPress function and class declaration stubs for stat...
php-webdriver/webdriver                1.12.1            A PHP client for Selenium WebDriver. Previously faceboo...
phpdocumentor/reflection-common        2.2.0             Common reflection classes used by phpdocumentor to refl...
phpdocumentor/reflection-docblock      5.3.0             With this component, a library can provide support for ...
phpdocumentor/type-resolver            1.6.1             A PSR-5 based resolver of Class names, Types and Struct...
phpoption/phpoption                    1.8.1             Option Type for PHP
phpspec/prophecy                       v1.15.0           Highly opinionated mocking framework for PHP 5.3+
phpstan/phpstan                        1.6.9             PHPStan - PHP Static Analysis Tool
phpunit/php-code-coverage              9.2.15            Library that provides collection, processing, and rende...
phpunit/php-file-iterator              3.0.6             FilterIterator implementation that filters files based ...
phpunit/php-invoker                    3.1.1             Invoke callables with a timeout
phpunit/php-text-template              2.0.4             Simple template engine.
phpunit/php-timer                      5.0.3             Utility class for timing
phpunit/phpunit                        9.5.13            The PHP Unit Testing framework.
pimple/pimple                          v3.5.0            Pimple, a simple Dependency Injection Container
pragmarx/google2fa                     8.0.0             A One Time Password Authentication package, compatible ...
psr/cache                              1.0.1             Common interface for caching libraries
psr/container                          1.1.2             Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher                   1.0.0             Standard interfaces for event handling.
psr/http-factory                       1.0.1             Common interfaces for PSR-7 HTTP message factories
psr/http-message                       1.0.1             Common interface for HTTP messages
psr/http-server-handler                1.0.1             Common interface for HTTP server-side request handler
psr/http-server-middleware             1.0.1             Common interface for HTTP server-side middleware
psr/log                                1.1.4             Common interface for logging libraries
psr/simple-cache                       1.0.1             Common interfaces for simple caching
ralouphie/getallheaders                3.0.3             A polyfill for getallheaders.
ramsey/collection                      1.2.2             A PHP library for representing and manipulating collect...
ramsey/uuid                            4.2.3             A PHP library for generating and working with universal...
react/promise                          v2.9.0            A lightweight implementation of CommonJS Promises/A for...
rector/rector                          0.12.18           Instant Upgrade and Automated Refactoring of any PHP code
rmccue/requests                        v1.8.1            A HTTP library written in PHP, for human beings.
sebastian/cli-parser                   1.0.1             Library for parsing CLI options
sebastian/code-unit                    1.0.8             Collection of value objects that represent the PHP code...
sebastian/code-unit-reverse-lookup     2.0.3             Looks up which function or method a line of code belong...
sebastian/comparator                   4.0.6             Provides the functionality to compare PHP values for eq...
sebastian/complexity                   2.0.2             Library for calculating the complexity of PHP code units
sebastian/diff                         4.0.4             Diff implementation
sebastian/environment                  5.1.4             Provides functionality to handle HHVM/PHP environments
sebastian/exporter                     4.0.4             Provides the functionality to export PHP variables for ...
sebastian/global-state                 5.0.5             Snapshotting of global state
sebastian/lines-of-code                1.0.3             Library for counting the lines of code in PHP source code
sebastian/object-enumerator            4.0.4             Traverses array structures and object graphs to enumera...
sebastian/object-reflector             2.0.4             Allows reflection of object attributes, including inher...
sebastian/recursion-context            4.0.4             Provides functionality to recursively process PHP varia...
sebastian/resource-operations          3.0.3             Provides a list of PHP built-in functions that operate ...
sebastian/type                         2.3.4             Collection of value objects that represent the types of...
sebastian/version                      3.0.2             Library that helps with managing the version number of ...
seld/jsonlint                          1.9.0             JSON Linter
seld/phar-utils                        1.2.0             PHAR file format utilities, for when PHP phars you up
snicco/better-wp-api                   v1.2.0            This small package tries to solve the pain point of not...
snicco/better-wp-cache                 v1.2.0           
snicco/better-wp-cache-bundle          v1.2.0           
snicco/better-wp-cli                   v1.2.0            The missing parts to the already awesome WP-CLI
snicco/better-wp-hooks                 v1.2.0           
snicco/better-wp-hooks-bundle          v1.2.0           
snicco/better-wp-mail                  v1.2.0            Keep your sanity when working with mails in WordPress
snicco/better-wp-mail-bundle           v1.2.0           
snicco/better-wp-mail-testing          v1.2.0            Provides test utilities for snicco/better-wp-mail
snicco/better-wpdb                     v1.2.0            Keeps you safe and sane when working with custom tables...
snicco/better-wpdb-bundle              v1.2.0           
snicco/debug-bundle                    v1.2.0           
snicco/encryption-bundle               v1.2.0           
snicco/event-dispatcher                v1.2.0           
snicco/event-dispatcher-testing        v1.2.0            Provides a testable adapter for the snicco/event-dispat...
snicco/http-routing                    v1.2.0            The HTTP and routing component of the snicco framework
snicco/http-routing-bundle             v1.2.0           
snicco/http-routing-testing            v1.2.0            Provides testing utilities for snicco/http-routing
snicco/kernel                          v1.2.0            The core of the snicco framework
snicco/method-override-middleware      v1.2.0           
snicco/pimple-bridge                   v1.2.0            Provides an adapter for the pimple DI container for sni...
snicco/psr7-error-handler              v1.2.0            A powerful and customizable error handler for psr7 apps.
snicco/session                         v1.2.0            A standalone session implementation for environments wh...
snicco/session-bundle                  v1.2.0           
snicco/session-psr16-bridge            v1.2.0           
snicco/session-wp-bridge               v1.2.0           
snicco/signed-url                      v1.2.0            A small, framework agnostic library to create and valid...
snicco/str-arr                         v1.2.0            A standalone implementation of Laravel's Str and Arr cl...
snicco/templating                      v1.2.0            Provides a unified API for various templating engines.
snicco/templating-bundle               v1.2.0           
snicco/testable-clock                  v1.2.0           
snicco/testing-bundle                  v1.2.0           
snicco/wp-nonce-middleware             v1.2.0           
sniccowp/php-scoper-wordpress-excludes 5.9.3             A list of all WordPress core classes, functions and con...
symfony/browser-kit                    v5.4.3            Simulates the behavior of a web browser, allowing you t...
symfony/config                         v5.4.8            Helps you find, load, combine, autofill and validate co...
symfony/console                        v5.4.7            Eases the creation of beautiful and testable command li...
symfony/css-selector                   v5.4.3            Converts CSS selectors to XPath expressions
symfony/dependency-injection           v5.4.8            Allows you to standardize and centralize the way object...
symfony/deprecation-contracts          v2.5.1            A generic function and convention to trigger deprecatio...
symfony/dom-crawler                    v5.4.6            Eases DOM navigation for HTML and XML documents
symfony/error-handler                  v5.4.8            Provides tools to manage errors and ease debugging PHP ...
symfony/event-dispatcher               v5.4.3            Provides tools that allow your application components t...
symfony/event-dispatcher-contracts     v2.5.1            Generic abstractions related to dispatching event
symfony/filesystem                     v5.4.7            Provides basic utilities for the filesystem
symfony/finder                         v5.4.8            Finds files and directories via an intuitive fluent int...
symfony/http-foundation                v5.4.8            Defines an object-oriented layer for the HTTP specifica...
symfony/http-kernel                    v5.4.8            Provides a structured process for converting a Request ...
symfony/polyfill-ctype                 v1.25.0           Symfony polyfill for ctype functions
symfony/polyfill-intl-grapheme         v1.25.0           Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-normalizer       v1.25.0           Symfony polyfill for intl's Normalizer class and relate...
symfony/polyfill-mbstring              v1.25.0           Symfony polyfill for the Mbstring extension
symfony/polyfill-php80                 v1.25.0           Symfony polyfill backporting some PHP 8.0+ features to ...
symfony/polyfill-php81                 v1.25.0           Symfony polyfill backporting some PHP 8.1+ features to ...
symfony/process                        v5.4.8            Executes commands in sub-processes
symfony/service-contracts              v2.5.1            Generic abstractions related to writing services
symfony/string                         v5.4.8            Provides an object-oriented API to strings and deals wi...
symfony/translation                    v5.4.8            Provides tools to internationalize your application
symfony/translation-contracts          v2.5.1            Generic abstractions related to translation
symfony/var-dumper                     v5.4.8            Provides mechanisms for walking through any arbitrary P...
symfony/yaml                           v5.4.3            Loads and dumps YAML files
symplify/autowire-array-parameter      v9.3.26           Autowire array parameters for your Symfony applications
symplify/composer-json-manipulator     v9.3.26           Package to load, merge and save composer.json file(s)
symplify/console-package-builder       v9.3.26           Package to speed up building command line applications
symplify/easy-coding-standard          10.1.2            Prefixed scoped version of ECS package
symplify/easy-testing                  v9.3.26           Testing made easy
symplify/monorepo-builder              9.4.70            Prefixed version of Not only Composer tools to build a ...
symplify/package-builder               v9.3.26           Dependency Injection, Console and Kernel toolkit for Sy...
symplify/smart-file-system             v9.3.26           Sanitized FileInfo with safe getRealPath() and other ha...
symplify/symplify-kernel               v9.3.26           Internal Kernel for Symplify packages
thecodingmachine/safe                  v1.3.3            PHP core functions that throw exceptions instead of ret...
theseer/tokenizer                      1.2.1             A small library for converting tokenized PHP source cod...
vimeo/psalm                            4.22.0            A static analysis tool for finding errors in PHP applic...
vlucas/phpdotenv                       v5.4.1            Loads environment variables from `.env` to `getenv()`, ...
voku/portable-ascii                    1.6.1             Portable ASCII library - performance optimized (ascii) ...
vria/nodiacritic                       0.1.2             Tiny helper function that removes all diacritical signs...
webimpress/safe-writer                 2.2.0             Tool to write files safely, to avoid race conditions
webmozart/assert                       1.10.0            Assertions to validate method input/output with nice er...
webmozart/path-util                    2.3.0             A robust cross-platform utility for normalizing, compar...
wp-cli/cache-command                   v2.0.9            Manages object and transient caches.
wp-cli/checksum-command                v2.1.2            Verifies file integrity by comparing to published check...
wp-cli/config-command                  v2.1.3            Generates and reads the wp-config.php file.
wp-cli/core-command                    v2.1.1            Downloads, installs, updates, and manages a WordPress i...
wp-cli/cron-command                    v2.1.0            Tests, runs, and deletes WP-Cron events; manages WP-Cro...
wp-cli/db-command                      v2.0.20           Performs basic database operations using credentials st...
wp-cli/embed-command                   v2.0.11           Inspects oEmbed providers, clears embed cache, and more.
wp-cli/entity-command                  v2.2.1            Manage WordPress comments, menus, options, posts, sites...
wp-cli/eval-command                    v2.1.2            Executes arbitrary PHP code or files.
wp-cli/export-command                  v2.0.11           Exports WordPress content to a WXR file.
wp-cli/extension-command               v2.1.4            Manages plugins and themes, including installs, activat...
wp-cli/i18n-command                    v2.3.0            Provides internationalization tools for WordPress proje...
wp-cli/import-command                  v2.0.8            Imports content from a given WXR file.
wp-cli/language-command                v2.0.12           Installs, activates, and manages language packs.
wp-cli/maintenance-mode-command        v2.0.8            Activates, deactivates or checks the status of the main...
wp-cli/media-command                   v2.0.12           Imports files as attachments, regenerates thumbnails, o...
wp-cli/mustangostang-spyc              0.6.3             A simple YAML loader/dumper class for PHP (WP-CLI fork)
wp-cli/package-command                 v2.2.2            Lists, installs, and removes WP-CLI packages.
wp-cli/php-cli-tools                   v0.11.13          Console utilities for PHP
wp-cli/rewrite-command                 v2.0.10           Lists or flushes the site's rewrite rules, updates the ...
wp-cli/role-command                    v2.0.9            Adds, removes, lists, and resets roles and capabilities.
wp-cli/scaffold-command                v2.0.16           Generates code for post types, taxonomies, blocks, plug...
wp-cli/search-replace-command          v2.0.16           Searches/replaces strings in the database.
wp-cli/server-command                  v2.0.10           Launches PHP's built-in web server for a specific WordP...
wp-cli/shell-command                   v2.0.11           Opens an interactive PHP console for running and testin...
wp-cli/super-admin-command             v2.0.10           Lists, adds, or removes super admin users on a multisit...
wp-cli/widget-command                  v2.1.7            Adds, moves, and removes widgets; lists sidebars.
wp-cli/wp-cli                          v2.6.0            WP-CLI framework
wp-cli/wp-cli-bundle                   v2.6.0            WP-CLI bundle package with default commands.
wp-cli/wp-config-transformer           v1.3.0            Programmatically edit a wp-config.php file.
zordius/lightncandy                    v1.2.6            An extremely fast PHP implementation of handlebars ( ht...

Current behaviour

If no API prefix is set in the routing configuration the testing browser will treat all non-admin-area requests as API requests.

Expected behaviour

By default, test requests should be frontend requests, if they are not going to the admin area. API requests should only be set if the prefix matches AND the API prefix is not empty

How to reproduce

This is the responsible code in Browser.php. A check for (string) "" is missing.

   if (0 === strpos($psr_server_request->getUri()->getPath(), $this->admin_area_prefix->asString())) {
            $type = Request::TYPE_ADMIN_AREA;
        } elseif (0 === strpos($psr_server_request->getUri()->getPath(), $this->api_prefix->asString())) {
            $type = Request::TYPE_API;
        } else {
            $type = Request::TYPE_FRONTEND;
        }

Possible solution

Check if the API prefix is empty.

Relevant log output

No response

Additional Context

No response

feat(psr7-error-handler): pass current request to exception transformers

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

psr7-error-handler

Description

It would be great if an ExceptionTransformer could receive the current server request that triggered the exception.

interface ExceptionTransformer
{
    public function transform(Throwable $e): Throwable;
}

Proposed solution

There is currently no way to change this interface without a BC break.

The best we could do is probably something that Symfony does often:

interface ExceptionTransformer
{
    public function transform(Throwable $e, /*ServerRequestInterface $request */): Throwable;
}

Alternatives

No response

[Feature]: Kernel Env's type annotation is too strict requiring double checking

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

kernel

Description

It is not necessary to pass a correct env string into the fromString method. This forces clients to needlessly type check before creating the Environment object. The value is always checked in the constructor

    /**
     * @param self::DEV|self::PROD|self::STAGING|self::TESTING $environment
     */
    public static function fromString(string $environment, bool $debug = false): self
    {
      
// constructor

 if (! in_array($environment, $this->validEnvironments(), true)) {
            throw new InvalidArgumentException(
                sprintf(
                    'App environment has to be one of [%s]. Got: [%s].',
                    implode(',', $this->validEnvironments()),
                    $environment
                )
            );
        }

Proposed solution

Remove the psalm annotations.

Alternatives

No response

[Feature]: Add WPNonce to ViewResponses for POST requests

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

wp-nonce-middleware

Description

Give view responses for POST request access to the WP_Nonce service.

Currently, only READ HTTP verbs receive an instance of WPNonce in their view data.

This makes using the middleware impossible to use if a view is returned for a POST request. For example, returning the same view with 4XX error after unsuccessful form validation.

Proposed solution

Add the logic for adding the WPNonce class for POST requests.

return $response->withViewData([
 'wp_nonce' => new WPNonce($this->url(), $this->wp, $current_path),
]);

Alternatives

No response

[Bug]: SignedUrl removes non standard HTTP ports from protected target

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

signed-url

Is this a regression?

No

Composer dependencies

//

Current behaviour

Signing the target url: https://foo.com:8443" will result in https://foo.com being used.

    /**
     * @psalm-suppress MixedOperand
     */
    private function getDomainAndSchema(array $parts): ?string
    {
        if (isset($parts['host'], $parts['scheme'])) {
            return $parts['scheme'] . '://' . $parts['host'];
        }

        return null;
    }

Expected behaviour

Non standard HTTP ports should not be removed.

How to reproduce

//

Possible solution

No response

Relevant log output

No response

Additional Context

No response

[Feature]: Throw custom exception for invalid nonces

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

wp-nonce-middleware

Description

It would be good to replace the generic HttpException thrown in the VerifyWPNonce middleware with a custom exception class so that it can be caught explicitly and transformed into a user-friendly error view.

Proposed solution

 if (! $this->wp->verifyNonce($nonce, $current_path)) {
      throw new HttpException(401, sprintf('Nonce check failed for request path [%s].', $current_path));
 }

We can replace the above code WITHOUT a BC break if we create a new exception class that extends HttpException.

class WPNonceIsInvalid extends HttpException {

//

}

Alternatives

No response

[Bug]: better-wp-cli fails for specific terminal window size

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

other/dont-know

Is this a regression?

No

Composer dependencies

//

Current behaviour

Running any command registered with BetterWPCLI will throw an exception if the terminal width is smaller than the sum of the output message and the line prefix length.

Expected behaviour

Running CLI commands should not fail for any terminal width.

How to reproduce

   ...

Possible solution

The responsible code in SniccoStyle.php should check that the second argument passed to str_repeat can't be smaller than zero.

// Current
 $right_padding = str_repeat(' ', $this->full_width - $line_prefix_length - $message_length);
 
 // Desired
$right_padding = str_repeat(' ', max($this->full_width - $line_prefix_length - $message_length, 0));

Relevant log output

Message: str_repeat(): Second argument has to be greater than or equal to 0
        Exception: ErrorException at REDACTED/vendor/snicco/better-wp-cli/src/Style/SniccoStyle.php on line 286

Additional Context

No response

docs(monorepo): update split-changelogs automatically

It would be great if we had a GitHub workflow that runs in each split repository after a new release. This workflow could fetch the latest changelog from the monorepo and extract the relevant changes for each split repository.

[Bug]: snicco/method-override-middleware has dependency it doesnt use

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

method-override-middleware

Is this a regression?

No

Composer dependencies

//

Current behaviour

The snicco/method-override-middleware has a dependeny declared in composer.json on middlewares/negotiation. This probably happened by accident during development. The dependency is not used at all.

Expected behaviour

The dependency should not be installed.

How to reproduce

composer require snicco/method-override-middleware

Possible solution

No response

Relevant log output

No response

Additional Context

No response

[Bug]: cant provide stream input as method argument to CommandTester

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

better-wp-cli

Is this a regression?

No

Composer dependencies

//

Current behaviour

This does not work:

 $tester->run([], [], [
            CommandTester::INTERACTIVE => true,
            CommandTester::INPUT => ['yes']
        ]);
 $options = array_replace($this->options, $options);
            $command = $this->getCommand();

            $input = new WPCLIInput(
                $command::synopsis(),
                $positional_args,
                $associative_args,
                $this->getInMemoryStream('r+', $this->options['input'] ?? []),
                $options[self::INTERACTIVE] ?? false,
            );

getInMemoryStream should be called with $options, not $this->options

Expected behaviour

You should be able to provide input per call of CommandTester::run() . The method input should overwrite the default input.

How to reproduce

    // Code goes here

Possible solution

No response

Relevant log output

No response

Additional Context

No response

ci(codecov): codecov.io gets stuck many on PRs

Recently codecov.io has been very unreliable in reporting back the project status check of a PR.

The coverage is uploaded correctly but the GitHub action status is never updated thus making it impossible to merge PRs.
This issue does not happen on pushes to master.

On all recent runs there is an error message in the GitHub action:

see: https://github.com/sniccowp/sniccowp/runs/5554516700?check_suite_focus=true#step:7:26.

Maybe we should dump the manual curl uploader and use the dedicated codecov GH action

feat(http-routing-bundle): create a dedicated http error logger marker interface

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

http-routing-bundle

Description

Currently, the PSR logger used for error logging in the main HTTP middleware pipeline is instantiated like so:

$error_logger = $container[TestLogger::class] ?? $container->make(LoggerInterface::class);

This forces the end user of the bundle to bind the PSR logger instance that handles error logging with the LoggerInterface::classs id in the container.

Proposed solution

$error_logger = $container[TestLogger::class] ?? ($container[HttpErrroLogger::class] ?? $container->make(LoggerInterface::class));

Alternatives

No response

[Bug]: Cached middleware does not respect global middleware settings

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

http-routing

Is this a regression?

No

Composer dependencies

//

Current behaviour

When the middleware resolver is cached, any requests without a route match will have the "frontend|admin|api|global" group applied to it.

Expected behaviour

The "frontend|admin|api|global" group should only be applied if they are also configured to be run for every request.

How to reproduce

//

Possible solution

No response

Relevant log output

No response

Additional Context

No response

[Bug]: afterConfiguration callbacks can not be added in bootstrappers, only in bundles

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

kernel

Is this a regression?

Yes

Composer dependencies

//

Current behaviour

foreach ($this->bundles as $bundle) {
            $bundle->configure($writable_config, $this);
        }

        $this->configuration_configured = true;

        foreach ($this->bootstrappers as $bootstrapper) {
            $bootstrapper->configure($writable_config, $this);
        }

Expected behaviour

foreach ($this->bundles as $bundle) {
            $bundle->configure($writable_config, $this);
        }

        foreach ($this->bootstrappers as $bootstrapper) {
            $bootstrapper->configure($writable_config, $this);
        }
        
          $this->configuration_configured = true;

How to reproduce

//

Possible solution

No response

Relevant log output

No response

Additional Context

No response

[Bug]: A mapped WordPress hook that passes null as the first argument will throw an exception.

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

better-wp-hooks

Is this a regression?

No

Composer dependencies

//

Current behaviour

A mapped WordPress hook that passes null as the first argument will throw an exception.

Expected behaviour

Null should be allowed as a first mapped argument.

How to reproduce

 $event_mapper->map('some_hook', 'SomeClass::class');
 
 do_action('some_hook', null, 'foo', 'bar');

Possible solution

 if (! isset($args_from_wordpress_hooks[0])) {
throw new RuntimeException(
                    sprintf('Event mapper received invalid arguments from WP for mapped hook [%s].', $event_class)
 );
}

We need to use array_key_exists instead of isset in EventMapper::dispatchMappedFilter

Relevant log output

No response

Additional Context

No response

[Docs]: add TLDR for commit Message Format in contributing.md

Thanks for taking the time to fill out this documentation request!"

  • I have searched the issue tracker for similar issues
  • I have searched the documentation of the relevant package(s)

Which @snicco/* package(s) have missing/wrong/unclear documenation?

monorepo

Which part of the documentation is unclear, missing or wrong?

Add a TL;DR to the commit message section.

[Feature]: Allow extening PHP views with different annotations.

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

templating

Description

Using the simple PHPViewFactory it is currently possible to extend a parent template by using the annotation.

<?php

/*
 *  Extends: layout.php
 */

?>

<h1> Hello World </h1>

It would be nice to expand support to using doc-block annotations instead of only simple multi-line comments.

<?php

/**
* Extends: layout.php
* 
* @var string $message
*/

?>

<h1> echo $message </h1>

The first option works currently, the second one does not.

Proposed solution

We would need to change the regex parsing in the PHPViewFactory::parseParentView method.

Alternatives

No response

[Feature]: log warnings if wp_mail implementation does use phpmailer_init hook

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

better-wp-mail

Description

Many plugins expect the WordPress Mail function (wp_mail) that SMTP plugins overwrite to fire the phpmailer_init | Hook | WordPress Developer Resources hook.

Some plugins, i.e., Postmark's SMTP plugin, do not do that.

For example, WooCommece uses the hook in some places:

https://github.com/search?q=repo%3Awoocommerce%2Fwoocommerce%20phpmailer_init&type=code

If the hook is not fired, emails might not be sent correctly, especially regarding data that can't be configured/passed directly into wp_mail.

Proposed solution

Track if the phpmailer_init function is fired during the WPMailTransport sending and either:

  • a) Log warnings.
  • b) Throw a CantSendEmail Exception.

For a) We'd also need to introduce a logger dependency in the package.

Alternatives

Fail silently.

[Bug]: distinguish between default php.ini and plugin output buffering

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

http-routing-bundle

Is this a regression?

No

Composer dependencies

//

Current behaviour

See: https://community.gridpane.com/t/new-log-items-appearing-in-the-last-couple-of-days/3559/7?u=calvin35

Expected behaviour

//

How to reproduce

  //

Possible solution

No response

Relevant log output

No response

Additional Context

No response

[Bug]: kernel does not check log dir permissions

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

kernel

Is this a regression?

No

Composer dependencies

//

Current behaviour

There is a typo in the kernel component.

Instead of checking the log+ cache dir for read/write permissions it checks the cache dir twice.

Expected behaviour

//

How to reproduce

    // Code goes here

Possible solution

No response

Relevant log output

No response

Additional Context

No response

[Bug]: Keyset pagination Query object turns table names to lowercase

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

better-wpdb

Is this a regression?

No

Composer dependencies

//

Current behaviour

 /**
     * @param string                                          $sql                           A select SQL query with optional where clauses at the end. The where clause should only use columns that have an index.
     * @param non-empty-array<non-empty-string, "asc"|"desc"> $deterministic_sorting_columns column names for sorting that ensure a deterministic sorting order
     * @param positive-int                                    $batch_size
     * @param scalar[]                                        $static_column_bindings        the values for "static" column values if the "$sql" query contains conditions
     */
    public function __construct(
        string $sql,
        array $deterministic_sorting_columns,
        int $batch_size = 500,
        array $static_column_bindings = []
    ) {
        if (substr_count($sql, '?') !== count($static_column_bindings)) {
            throw new InvalidArgumentException(
                'The placeholder count does not match the count of static column values.'
            );
        }

        $sql = strtolower($sql);
        $this->sorting_column_names = array_keys($deterministic_sorting_columns);
        $this->static_column_bindings = $static_column_bindings;
        $this->batch_size = $batch_size;

        $this->where = (false !== strpos($sql, 'where'))
            ? ' and '
            : ' where ';

        $this->order_by = ' order by ';

        $this->applyCursorQuery($deterministic_sorting_columns);

        $this->sql_first_batch = $sql . $this->order_by . ' limit ? ';
        $this->sql_nth_batch = $sql . $this->where . $this->order_by . ' limit ? ';
    }

Expected behaviour

Turning the query to lowercase is impossible, as in the constructor.

This will fail for column/table names in uppercase.

How to reproduce

Possible solution

No response

Relevant log output

No response

Additional Context

No response

[Bug]: Testing browser does not convert HTTP_X server params to headers

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

testing-bundle

Is this a regression?

No

Composer dependencies

amphp/amp                              v2.6.2            A non-blocking concurrency framework for PHP applicat...
amphp/byte-stream                      v1.8.1            A stream abstraction to make working with non-blockin...
antecedent/patchwork                   2.1.21            Method redefinition (monkey-patching) functionality f...
behat/gherkin                          v4.9.0            Gherkin DSL parser for PHP
bjeavons/zxcvbn-php                    1.3.1             Realistic password strength estimation PHP library ba...
bordoni/phpass                         0.3.5             Portable PHP password hashing framework
brick/math                             0.9.3             Arbitrary-precision arithmetic library
cache/simple-cache-bridge              1.2.0             A PSR-6 bridge to PSR-16. This will make any PSR-6 ca...
cache/tag-interop                      1.1.0             Framework interoperable interfaces for tags
cache/taggable-cache                   1.2.0             Add tag support to your PSR-6 cache implementation
codeception/codeception                4.1.x-dev e13382c BDD-style testing framework
codeception/lib-asserts                2.0.0             Assertion methods used by Codeception core and Assert...
codeception/module-cli                 1.1.1             Codeception module for testing basic shell commands a...
codeception/module-db                  1.2.0             DB module for Codeception
codeception/module-webdriver           1.4.0             WebDriver module for Codeception
codeception/phpunit-wrapper            9.0.9             PHPUnit classes used by Codeception
codeception/stub                       4.0.2             Flexible Stub wrapper for PHPUnit's Mock Builder
composer/ca-bundle                     1.3.1             Lets you find a path to the system CA bundle, and inc...
composer/composer                      2.3.5             Composer helps you declare, manage and install depend...
composer/metadata-minifier             1.0.0             Small utility library that handles metadata minificat...
composer/package-versions-deprecated   1.11.99.5         Composer plugin that provides efficient querying for ...
composer/pcre                          3.0.0             PCRE wrapping library that offers type-safe preg_* re...
composer/semver                        3.3.2             Semver library that offers utilities, version constra...
composer/spdx-licenses                 1.5.7             SPDX licenses list and validation library.
composer/xdebug-handler                3.0.3             Restarts a process without Xdebug.
defuse/php-encryption                  v2.3.1            Secure PHP Encryption Library
dg/mysql-dump                          v1.5.1            MySQL database dump.
dnoegel/php-xdg-base-dir               v0.1.1            implementation of xdg base directory specification fo...
doctrine/inflector                     2.0.4             PHP Doctrine Inflector is a small library that can pe...
doctrine/instantiator                  1.4.1             A small, lightweight utility to instantiate objects i...
eftec/bladeone                         3.52              The standalone version Blade Template Engine from Lar...
felixfbecker/advanced-json-rpc         v3.2.1            A more advanced JSONRPC implementation
felixfbecker/language-server-protocol  v1.5.2            PHP classes for the Language Server Protocol
fidry/console                          0.4.0             Library to create CLI applications
filp/whoops                            2.14.5            php error handling for cool kids
gettext/gettext                        v4.8.6            PHP gettext manager
gettext/languages                      2.9.0             gettext languages with plural rules
graham-campbell/result-type            v1.0.4            An Implementation Of The Result Type
guzzlehttp/psr7                        2.2.1             PSR-7 message implementation that also provides commo...
humbug/php-scoper                      0.17.2            Prefixes all PHP namespaces in a file or directory.
illuminate/collections                 v8.83.13          The Illuminate Collections package.
illuminate/contracts                   v8.83.13          The Illuminate Contracts package.
illuminate/macroable                   v8.83.13          The Illuminate Macroable package.
illuminate/support                     v8.83.13          The Illuminate Support package.
jetbrains/phpstorm-stubs               v2021.3           PHP runtime & extensions header files for PhpStorm
justinrainbow/json-schema              5.2.12            A library to validate a json schema.
laminas/laminas-httphandlerrunner      2.1.0             Execute PSR-15 RequestHandlerInterface instances and ...
league/tactician                       v1.1.0            A small, flexible command bus. Handy for building ser...
league/tactician-logger                v0.11.0           Adds PSR-3 logging support to the Tactician command bus
lucatume/wp-browser                    3.1.6             WordPress extension of the PhpBrowser class.
mck89/peast                            v1.14.0           Peast is PHP library that generates AST for JavaScrip...
middlewares/negotiation                v2.1.0            Middleware to implement content negotiation
middlewares/utils                      v3.3.0            Common utils for PSR-15 middleware packages
mikehaertl/php-shellcommand            1.6.4             An object oriented interface to shell commands
mikemclin/laravel-wp-password          2.0.3             Laravel package that checks and creates WordPress pas...
mustache/mustache                      v2.14.1           A Mustache implementation in PHP.
myclabs/deep-copy                      1.11.0            Create deep copies (clones) of your objects
nb/oxymel                              v0.1.0            A sweet XML builder
nesbot/carbon                          2.58.0            An API extension for DateTime that supports 281 diffe...
netresearch/jsonmapper                 v4.0.0            Map nested JSON structures onto PHP classes
nette/neon                             v3.3.3            🍸 Nette NEON: encodes and decodes NEON file format.
nette/utils                            v3.2.7            🛠  Nette Utils: lightweight utilities for string &...
nikic/fast-route                       v1.3.0            Fast request router for PHP
nikic/php-parser                       v4.13.2           A PHP parser written in PHP
nyholm/psr7                            1.5.0             A fast PHP7 implementation of PSR-7
nyholm/psr7-server                     1.0.2             Helper classes to handle PSR-7 server requests
openlss/lib-array2xml                  1.0.0             Array2XML conversion library credit to lalit.org
paragonie/constant_time_encoding       v2.5.0            Constant-time Implementations of RFC 4648 Encoding (B...
paragonie/password_lock                v3.1.0            Wraps Bcrypt-SHA2 in Authenticated Encryption
paragonie/random_compat                v9.99.100         PHP 5.x polyfill for random_bytes() and random_int() ...
phar-io/manifest                       2.0.3             Component for reading phar.io manifest information fr...
phar-io/version                        3.2.1             Library for handling version information and constraints
php-http/message-factory               v1.0.2            Factory interfaces for PSR-7 HTTP Message
php-stubs/wordpress-stubs              v5.9.3            WordPress function and class declaration stubs for st...
php-webdriver/webdriver                1.12.1            A PHP client for Selenium WebDriver. Previously faceb...
phpdocumentor/reflection-common        2.2.0             Common reflection classes used by phpdocumentor to re...
phpdocumentor/reflection-docblock      5.3.0             With this component, a library can provide support fo...
phpdocumentor/type-resolver            1.6.1             A PSR-5 based resolver of Class names, Types and Stru...
phpoption/phpoption                    1.8.1             Option Type for PHP
phpspec/prophecy                       v1.15.0           Highly opinionated mocking framework for PHP 5.3+
phpstan/phpstan                        1.6.9             PHPStan - PHP Static Analysis Tool
phpunit/php-code-coverage              9.2.15            Library that provides collection, processing, and ren...
phpunit/php-file-iterator              3.0.6             FilterIterator implementation that filters files base...
phpunit/php-invoker                    3.1.1             Invoke callables with a timeout
phpunit/php-text-template              2.0.4             Simple template engine.
phpunit/php-timer                      5.0.3             Utility class for timing
phpunit/phpunit                        9.5.13            The PHP Unit Testing framework.
pimple/pimple                          v3.5.0            Pimple, a simple Dependency Injection Container
pragmarx/google2fa                     8.0.0             A One Time Password Authentication package, compatibl...
psr/cache                              1.0.1             Common interface for caching libraries
psr/container                          1.1.2             Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher                   1.0.0             Standard interfaces for event handling.
psr/http-factory                       1.0.1             Common interfaces for PSR-7 HTTP message factories
psr/http-message                       1.0.1             Common interface for HTTP messages
psr/http-server-handler                1.0.1             Common interface for HTTP server-side request handler
psr/http-server-middleware             1.0.1             Common interface for HTTP server-side middleware
psr/log                                1.1.4             Common interface for logging libraries
psr/simple-cache                       1.0.1             Common interfaces for simple caching
ralouphie/getallheaders                3.0.3             A polyfill for getallheaders.
ramsey/collection                      1.2.2             A PHP library for representing and manipulating colle...
ramsey/uuid                            4.2.3             A PHP library for generating and working with univers...
react/promise                          v2.9.0            A lightweight implementation of CommonJS Promises/A f...
rector/rector                          0.12.18           Instant Upgrade and Automated Refactoring of any PHP ...
rmccue/requests                        v1.8.1            A HTTP library written in PHP, for human beings.
sebastian/cli-parser                   1.0.1             Library for parsing CLI options
sebastian/code-unit                    1.0.8             Collection of value objects that represent the PHP co...
sebastian/code-unit-reverse-lookup     2.0.3             Looks up which function or method a line of code belo...
sebastian/comparator                   4.0.6             Provides the functionality to compare PHP values for ...
sebastian/complexity                   2.0.2             Library for calculating the complexity of PHP code units
sebastian/diff                         4.0.4             Diff implementation
sebastian/environment                  5.1.4             Provides functionality to handle HHVM/PHP environments
sebastian/exporter                     4.0.4             Provides the functionality to export PHP variables fo...
sebastian/global-state                 5.0.5             Snapshotting of global state
sebastian/lines-of-code                1.0.3             Library for counting the lines of code in PHP source ...
sebastian/object-enumerator            4.0.4             Traverses array structures and object graphs to enume...
sebastian/object-reflector             2.0.4             Allows reflection of object attributes, including inh...
sebastian/recursion-context            4.0.4             Provides functionality to recursively process PHP var...
sebastian/resource-operations          3.0.3             Provides a list of PHP built-in functions that operat...
sebastian/type                         2.3.4             Collection of value objects that represent the types ...
sebastian/version                      3.0.2             Library that helps with managing the version number o...
seld/jsonlint                          1.9.0             JSON Linter
seld/phar-utils                        1.2.0             PHAR file format utilities, for when PHP phars you up
snicco/better-wp-api                   v1.2.0            This small package tries to solve the pain point of n...
snicco/better-wp-cache                 v1.2.0           
snicco/better-wp-cache-bundle          v1.2.0           
snicco/better-wp-cli                   v1.2.0            The missing parts to the already awesome WP-CLI
snicco/better-wp-hooks                 v1.2.0           
snicco/better-wp-hooks-bundle          v1.2.0           
snicco/better-wp-mail                  v1.2.0            Keep your sanity when working with mails in WordPress
snicco/better-wp-mail-bundle           v1.2.0           
snicco/better-wp-mail-testing          v1.2.0            Provides test utilities for snicco/better-wp-mail
snicco/better-wpdb                     v1.2.0            Keeps you safe and sane when working with custom tabl...
snicco/better-wpdb-bundle              v1.2.0           
snicco/content-negotiation-middleware  v1.2.0           
snicco/debug-bundle                    v1.2.0           
snicco/encryption-bundle               v1.2.0           
snicco/event-dispatcher                v1.2.0           
snicco/event-dispatcher-testing        v1.2.0            Provides a testable adapter for the snicco/event-disp...
snicco/http-routing                    v1.2.0            The HTTP and routing component of the snicco framework
snicco/http-routing-bundle             v1.2.0           
snicco/http-routing-testing            v1.2.0            Provides testing utilities for snicco/http-routing
snicco/kernel                          v1.2.0            The core of the snicco framework
snicco/method-override-middleware      v1.2.0           
snicco/payload-middleware              v1.2.0           
snicco/pimple-bridge                   v1.2.0            Provides an adapter for the pimple DI container for s...
snicco/psr7-error-handler              v1.2.0            A powerful and customizable error handler for psr7 apps.
snicco/session                         v1.2.0            A standalone session implementation for environments ...
snicco/session-bundle                  v1.2.0           
snicco/session-psr16-bridge            v1.2.0           
snicco/session-wp-bridge               v1.2.0           
snicco/signed-url                      v1.2.0            A small, framework agnostic library to create and val...
snicco/str-arr                         v1.2.0            A standalone implementation of Laravel's Str and Arr ...
snicco/templating                      v1.2.0            Provides a unified API for various templating engines.
snicco/templating-bundle               v1.2.0           
snicco/testable-clock                  v1.2.0           
snicco/testing-bundle                  v1.2.0           
snicco/wp-nonce-middleware             v1.2.0           
sniccowp/php-scoper-wordpress-excludes 5.9.3             A list of all WordPress core classes, functions and c...
symfony/browser-kit                    v5.4.3            Simulates the behavior of a web browser, allowing you...
symfony/config                         v5.4.8            Helps you find, load, combine, autofill and validate ...
symfony/console                        v5.4.7            Eases the creation of beautiful and testable command ...
symfony/css-selector                   v5.4.3            Converts CSS selectors to XPath expressions
symfony/dependency-injection           v5.4.8            Allows you to standardize and centralize the way obje...
symfony/deprecation-contracts          v2.5.1            A generic function and convention to trigger deprecat...
symfony/dom-crawler                    v5.4.6            Eases DOM navigation for HTML and XML documents
symfony/error-handler                  v5.4.8            Provides tools to manage errors and ease debugging PH...
symfony/event-dispatcher               v5.4.3            Provides tools that allow your application components...
symfony/event-dispatcher-contracts     v2.5.1            Generic abstractions related to dispatching event
symfony/filesystem                     v5.4.7            Provides basic utilities for the filesystem
symfony/finder                         v5.4.8            Finds files and directories via an intuitive fluent i...
symfony/http-foundation                v5.4.8            Defines an object-oriented layer for the HTTP specifi...
symfony/http-kernel                    v5.4.8            Provides a structured process for converting a Reques...
symfony/polyfill-ctype                 v1.25.0           Symfony polyfill for ctype functions
symfony/polyfill-intl-grapheme         v1.25.0           Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-normalizer       v1.25.0           Symfony polyfill for intl's Normalizer class and rela...
symfony/polyfill-mbstring              v1.25.0           Symfony polyfill for the Mbstring extension
symfony/polyfill-php80                 v1.25.0           Symfony polyfill backporting some PHP 8.0+ features t...
symfony/polyfill-php81                 v1.25.0           Symfony polyfill backporting some PHP 8.1+ features t...
symfony/process                        v5.4.8            Executes commands in sub-processes
symfony/service-contracts              v2.5.1            Generic abstractions related to writing services
symfony/string                         v5.4.8            Provides an object-oriented API to strings and deals ...
symfony/translation                    v5.4.8            Provides tools to internationalize your application
symfony/translation-contracts          v2.5.1            Generic abstractions related to translation
symfony/var-dumper                     v5.4.8            Provides mechanisms for walking through any arbitrary...
symfony/yaml                           v5.4.3            Loads and dumps YAML files
symplify/autowire-array-parameter      v9.3.26           Autowire array parameters for your Symfony applications
symplify/composer-json-manipulator     v9.3.26           Package to load, merge and save composer.json file(s)
symplify/console-package-builder       v9.3.26           Package to speed up building command line applications
symplify/easy-coding-standard          10.1.2            Prefixed scoped version of ECS package
symplify/easy-testing                  v9.3.26           Testing made easy
symplify/monorepo-builder              9.4.70            Prefixed version of Not only Composer tools to build ...
symplify/package-builder               v9.3.26           Dependency Injection, Console and Kernel toolkit for ...
symplify/smart-file-system             v9.3.26           Sanitized FileInfo with safe getRealPath() and other ...
symplify/symplify-kernel               v9.3.26           Internal Kernel for Symplify packages
thecodingmachine/safe                  v1.3.3            PHP core functions that throw exceptions instead of r...
theseer/tokenizer                      1.2.1             A small library for converting tokenized PHP source c...
vimeo/psalm                            4.22.0            A static analysis tool for finding errors in PHP appl...
vlucas/phpdotenv                       v5.4.1            Loads environment variables from `.env` to `getenv()`...
voku/portable-ascii                    1.6.1             Portable ASCII library - performance optimized (ascii...
vria/nodiacritic                       0.1.2             Tiny helper function that removes all diacritical sig...
webimpress/safe-writer                 2.2.0             Tool to write files safely, to avoid race conditions
webmozart/assert                       1.10.0            Assertions to validate method input/output with nice ...
webmozart/path-util                    2.3.0             A robust cross-platform utility for normalizing, comp...
willdurand/negotiation                 3.1.0             Content Negotiation tools for PHP provided as a stand...
wp-cli/cache-command                   v2.0.9            Manages object and transient caches.
wp-cli/checksum-command                v2.1.2            Verifies file integrity by comparing to published che...
wp-cli/config-command                  v2.1.3            Generates and reads the wp-config.php file.
wp-cli/core-command                    v2.1.1            Downloads, installs, updates, and manages a WordPress...
wp-cli/cron-command                    v2.1.0            Tests, runs, and deletes WP-Cron events; manages WP-C...
wp-cli/db-command                      v2.0.20           Performs basic database operations using credentials ...
wp-cli/embed-command                   v2.0.11           Inspects oEmbed providers, clears embed cache, and more.
wp-cli/entity-command                  v2.2.1            Manage WordPress comments, menus, options, posts, sit...
wp-cli/eval-command                    v2.1.2            Executes arbitrary PHP code or files.
wp-cli/export-command                  v2.0.11           Exports WordPress content to a WXR file.
wp-cli/extension-command               v2.1.4            Manages plugins and themes, including installs, activ...
wp-cli/i18n-command                    v2.3.0            Provides internationalization tools for WordPress pro...
wp-cli/import-command                  v2.0.8            Imports content from a given WXR file.
wp-cli/language-command                v2.0.12           Installs, activates, and manages language packs.
wp-cli/maintenance-mode-command        v2.0.8            Activates, deactivates or checks the status of the ma...
wp-cli/media-command                   v2.0.12           Imports files as attachments, regenerates thumbnails,...
wp-cli/mustangostang-spyc              0.6.3             A simple YAML loader/dumper class for PHP (WP-CLI fork)
wp-cli/package-command                 v2.2.2            Lists, installs, and removes WP-CLI packages.
wp-cli/php-cli-tools                   v0.11.13          Console utilities for PHP
wp-cli/rewrite-command                 v2.0.10           Lists or flushes the site's rewrite rules, updates th...
wp-cli/role-command                    v2.0.9            Adds, removes, lists, and resets roles and capabilities.
wp-cli/scaffold-command                v2.0.16           Generates code for post types, taxonomies, blocks, pl...
wp-cli/search-replace-command          v2.0.16           Searches/replaces strings in the database.
wp-cli/server-command                  v2.0.10           Launches PHP's built-in web server for a specific Wor...
wp-cli/shell-command                   v2.0.11           Opens an interactive PHP console for running and test...
wp-cli/super-admin-command             v2.0.10           Lists, adds, or removes super admin users on a multis...
wp-cli/widget-command                  v2.1.7            Adds, moves, and removes widgets; lists sidebars.
wp-cli/wp-cli                          v2.6.0            WP-CLI framework
wp-cli/wp-cli-bundle                   v2.6.0            WP-CLI bundle package with default commands.
wp-cli/wp-config-transformer           v1.3.0            Programmatically edit a wp-config.php file.
zordius/lightncandy                    v1.2.6            An extremely fast PHP implementation of handlebars ( ...

Current behaviour

When creating a request with the test browser, server params are not transformed to headers.

Expected behaviour

When creating a request with the testing browser server params starting with HTTP_XXX or CONTENT_XXX should be converted to headers in the PSR7 response that is piped through the application.

How to reproduce

$browser->request('POST', '/foo', [
  'bar' => 'baz'
], [], ['HTTP_ACCEPT' => 'application/json']);

The request that is received should have an ACCEPT header but doesn't.

Possible solution

In Browser::filterRequest where we receive the Symfony browser kit response:

$psr_server_request = $this->request_factory->createServerRequest(
            $request->getMethod(),
            $request->getUri(),
            $server = $request->getServer(),
        );
       
       // This is new
        foreach ($server as $key => $value) {
    
            if ($value && 0 === \strpos($key, 'HTTP_')) {
                $name = \strtr(\strtolower(\substr($key, 5)), '_', '-');
                $psr_server_request = $psr_server_request->withHeader($name, $value);
        
                continue;
            }
    
            if ($value && 0 === \strpos($key, 'CONTENT_')) {
                $name = 'content-'.\strtolower(\substr($key, 8));
                $psr_server_request = $psr_server_request->withHeader($name, $value);
        
                continue;
            }
            
        }

Relevant log output

No response

Additional Context

No response

[Bug]: UrlGeneration context does not work with hosts that dont contain a "."

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

http-routing, http-routing-bundle

Is this a regression?

No

Composer dependencies

//

Current behaviour

// UrlGenerationContext::construct
Assert::stringNotEmpty($host, '$host cant be empty.');
Assert::contains($host, '.', 'Expected $host to contain a [.].');
Assert::notContains($host, 'http', '$host must not contain a scheme.');
Assert::notContains($host, '://', '$host must not contain a scheme.');

Expected behaviour

Hosts like "nginx" (docker), "localhost" etc should be valid.

How to reproduce

new UrlGenerationContext('nginx');

Possible solution

No response

Relevant log output

No response

Additional Context

No response

[BUG]: Exception transformer cant be loaded from DI container

Thanks for taking the time to fill out this bug report!"

  • I have searched the issue tracker for similar issues
  • I have verified that the issue is present when using the most recent version of the affected package(s)

Which @snicco/* package(s) are the source of the bug?

http-routing-bundle

Is this a regression?

No

Composer dependencies

filp/whoops                       2.14.5     php error handling for cool kids
laminas/laminas-httphandlerrunner 2.1.0      Execute PSR-15 RequestHandlerInterface instances and emit responses...
league/tactician                  v1.1.0     A small, flexible command bus. Handy for building service layers.
league/tactician-logger           v0.11.0    Adds PSR-3 logging support to the Tactician command bus
middlewares/negotiation           v2.1.0     Middleware to implement content negotiation
middlewares/utils                 v3.3.0     Common utils for PSR-15 middleware packages
nikic/fast-route                  v1.3.0     Fast request router for PHP
nyholm/psr7                       1.5.0      A fast PHP7 implementation of PSR-7
nyholm/psr7-server                1.0.2      Helper classes to handle PSR-7 server requests
paragonie/random_compat           v9.99.100  PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
php-http/message-factory          v1.0.2     Factory interfaces for PSR-7 HTTP Message
pimple/pimple                     v3.5.0     Pimple, a simple Dependency Injection Container
psr/container                     1.1.2      Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher              1.0.0      Standard interfaces for event handling.
psr/http-factory                  1.0.1      Common interfaces for PSR-7 HTTP message factories
psr/http-message                  1.0.1      Common interface for HTTP messages
psr/http-server-handler           1.0.1      Common interface for HTTP server-side request handler
psr/http-server-middleware        1.0.1      Common interface for HTTP server-side middleware
psr/log                           1.1.4      Common interface for logging libraries
ramsey/uuid                       3.9.6      Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 v...
snicco/application-layer-bundle   dev-master An application layer bundle for building large, enterprise WordPres...
snicco/better-wp-api              v1.0.1     This small package tries to solve the pain point of not being able ...
snicco/better-wp-hooks            v1.0.1    
snicco/better-wp-hooks-bundle     v1.0.1    
snicco/better-wpdb                v1.0.1     Keeps you safe and sane when working with custom tables in WordPress.
snicco/better-wpdb-bundle         v1.0.1    
snicco/debug-bundle               v1.0.1    
snicco/event-dispatcher           v1.0.1    
snicco/http-routing               v1.0.1     The HTTP and routing component of the snicco framework
snicco/http-routing-bundle        v1.0.1    
snicco/kernel                     v1.0.1     The core of the snicco framework
snicco/method-override-middleware v1.0.1    
snicco/pimple-bridge              v1.0.1     Provides an adapter for the pimple DI container for snicco/kernel
snicco/psr7-error-handler         v1.0.1     A powerful and customizable error handler for psr7 apps.
snicco/str-arr                    v1.0.1     A standalone implementation of Laravel's Str and Arr classes.
snicco/templating                 v1.0.1     Provides a unified API for various templating engines.
snicco/templating-bundle          v1.0.1    
symfony/polyfill-ctype            v1.25.0    Symfony polyfill for ctype functions
webimpress/safe-writer            2.2.0      Tool to write files safely, to avoid race conditions
webmozart/assert                  1.10.0     Assertions to validate method input/output with nice error messages.
willdurand/negotiation            3.1.0      Content Negotiation tools for PHP provided as a standalone library.

Current behaviour

It's not possible to load a custom ExceptionTransformer from the DI container.

A check for existence in the container is missing here

Assuming a "newable" class should be done only as a fallback.

Expected behaviour

//

How to reproduce

//

Possible solution

No response

Relevant log output

No response

Additional Context

No response

[Feature]: Allow multiple distinct url prefixes to act as "early routes"

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

http-routing-bundle

Description

Currently, the HttpKernelRunner class takes a single "api" prefix to determine if a route should be loaded early.

 private function isApiRequest(ServerRequestInterface $request): bool
    {
        return $this->api_prefix && Str::startsWith($request->getUri()->getPath(), $this->api_prefix);
   }

It would be good to allow multiple distinct prefixes from acting as "API" routes that should be loaded early in the WP loading process.

I.E.

  • /my-plugin/rest-api
  • /my-plugin/pages

Proposed solution

Change the constructor arguments of HttpKernelRunner to accept string|string[]

/**
 * @param non-empty-string|non-empty-string[]|null $api_prefix
*/
public function __construct(
        HttpKernel $http_kernel,
        ServerRequestCreator $request_creator,
        EventDispatcherInterface $event_dispatcher,
        ResponseEmitter $emitter,
        StreamFactoryInterface $stream_factory,
        ? $api_prefix
    ) {
        $this->http_kernel = $http_kernel;
        $this->request_creator = $request_creator;
        $this->event_dispatcher = $event_dispatcher;
        $this->emitter = $emitter;
        $this->stream_factory = $stream_factory;

        if (null !== $api_prefix) {
            $api_prefix = '/' . ltrim($api_prefix, '/');
        }

        $this->api_prefix = $api_prefix;
}

Alternatives

Currently the above is only possible by structuring URLs like so:

  • /my-plugin/EARLY/rest-api
  • /my-plugin/EARLY/pages

(EARLY is some shared "sub" prefix that is currently needed")

feat(testing-bundle): create session tokens and cookies in AuthenticateWithWordPress::loginAs()

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

testing-bundle

Description

    /**
     * @param int|WP_User $user
     */
    final protected function loginAs($user): void
    {
        $id = $user instanceof WP_User ? $user->ID : $user;
        wp_set_current_user($id);
    }

This method should create sessions in the database and cookies so that other wp functions such as session token work correctly.

Proposed solution

Use WP_Session_Tokens and wp_generate_auth_cookie

Alternatives

No response

[Feature]: CommandTester should merge default WP-CLI options

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

better-wp-cli-testing

Description

 $input = new WPCLIInput(
                $command::synopsis(),
                $positional_args,
                $associative_args,
                $this->getInMemoryStream('r+', $options['input'] ?? []),
                $options[self::INTERACTIVE] ?? false,
            );

We have access to the command synopsis, so we could merge all default values of InputOptions (if any) with the associative args.

Proposed solution

//

Alternatives

No response

Codecoverage workflow

We need a code coverage workflow that collects coverage once for the PHPUnit runner and once for the codeception runner.

Coverage should be collected in a separate workflow and not inside the tests.yaml.

See: https://github.com/php-coveralls/php-coveralls for how to merge several coverage reports into one and sent them to coveralls.io.

Also, all codeception.dist.yml files need to be configured to collect coverage based on an environment variable.

chore(monorepo): keep composer configs clean

Thanks for taking the time to fill out this documentation request!"

  • I have searched the issue tracker for similar issues
  • I have searched the documentation of the relevant package(s)

Which @snicco/* package(s) have missing/wrong/unclear documenation?

monorepo

Which part of the documentation is unclear, missing or wrong?

Please consider keeping Composer configuration files clean.

Add descriptions.

snicco/better-wp-cli                   v1.2.1  The missing parts to the already awesome WP-CLI
snicco/better-wp-hooks                 v1.2.1
snicco/better-wp-hooks-bundle          v1.2.1
snicco/better-wpdb                     v1.2.1  Keeps you safe and sane when working with custom tables in WordPress.
snicco/better-wpdb-bundle              v1.2.1
snicco/event-dispatcher                v1.2.1
snicco/http-routing                    v1.2.1  The HTTP and routing component of the snicco framework
snicco/http-routing-bundle             v1.2.1
snicco/kernel                          v1.2.1  The core of the snicco framework
snicco/method-override-middleware      v1.2.1
snicco/pimple-bridge                   v1.2.1  Provides an adapter for the pimple DI container for snicco/kernel
snicco/psr7-error-handler              v1.2.1  A powerful and customizable error handler for psr7 apps.
snicco/str-arr                         v1.2.1  A standalone implementation of Laravel's Str and Arr classes.
snicco/templating                      v1.2.1  Provides a unified API for various templating engines.
snicco/templating-bundle               v1.2.1
snicco/wp-nonce-middleware             v1.2.1
sniccowp/php-scoper-wordpress-excludes 5.9.3   A list of all WordPress core classes, functions and constants. Meant...

Normalize configs
https://github.com/ergebnis/composer-normalize

Check configs in CI
composer validate --strict

[Feature]: Kernel::afterConfigurationLoaded is misleading.

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

kernel

Description

The Kernel::afterConfigurationLoaded method is run after the config files are loaded from disk BUT before all bundles are configured.

This makes it impossible for a bundle to add lifecycle hooks from inside the configure method.

Trying to do that should throw a LogicException.

It would be great to have something like a Kernel::afterConfigurationConfigured method that runs after all bundles and bootstrappers have been configured.

Proposed solution

Add a new method like afterConfigurationConfigured or beforeConfigurationCached to the Kernel class.

Keep afterConfigurationLoaded the same as is and document that it is more like afterConfigurationLoadedFromDisk.

Alternatives

No response

[Docs]: add psalm annotations that Arr:mergeRecursive is supposed to only work with "string" keys.

Thanks for taking the time to fill out this documentation request!"

  • I have searched the issue tracker for similar issues
  • I have searched the documentation of the relevant package(s)

Which @snicco/* package(s) have missing/wrong/unclear documenation?

str-arr

Which part of the documentation is unclear, missing or wrong?

Arr::mergeRecursive will replace keys.

i.e.

Arr::mergeRecursive(['foo'], ['bar']);

will output

=> ['bar']

[Feature]: Add "real" request method to test requests' server params

Thanks for taking the time to fill out this feature request!"

  • I have searched the issue tracker for similar requests

Which @snicco/* package(s) are relevant/related of the feature request?

testing-bundle

Description

Currently, test requests are created like this with Symfony's Browser class:

$psr_server_request = $this->request_factory->createServerRequest(
     $request->getMethod(),
      $request->getUri(),
      $request->getServer(),
);

We should merge the REQUEST_METHOD parameter with $request->getServer() since Symfony will not include it by default.

This is important for our custom PSR7 Request class and the Request::realMethod method.

Proposed solution

See above.

Alternatives

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.