Skip to content

Commit

Permalink
Merge branch '1.x' into flysystem
Browse files Browse the repository at this point in the history
  • Loading branch information
srtfisher authored Nov 27, 2023
2 parents 94f81cc + 3739abb commit 8b676c7
Show file tree
Hide file tree
Showing 99 changed files with 1,841 additions and 432 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/split_monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# required for matrix of packages set
- uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
package: ${{fromJson(needs.provide_packages_json.outputs.matrix)}}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# no tag
-
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main

Expand All @@ -21,7 +21,7 @@ jobs:
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: Update CHANGELOG
Expand Down
43 changes: 41 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,45 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v0.12.9 - 2023-11-27

### Changed

- Removed PHPUnit 10 support to prevent a breaking change. Moved to 1.x.

## v0.12.8 - 2023-11-21

### Changed

- Added PHPUnit 10 support.

## v0.12.8 - 2023-11-14

### Added

- Adding block assertions to strings.
- Allow partial matching of HTML content by xpath selectors.
- Add a shutdown handler to the installation script to prevent silent fatals.

### Fixed

- Ensure factories can be used with data providers.

## v0.12.7 - 2023-10-02

### Added

- Adding date query builder for posts.
- Adds a trait to easily silence remote requests during testing.

### Changed

- Improve the messaging of assertions when testing.

### Fixed

- Ensure that attribute and action methods are deduplicated in service providers.

## v0.12.6 - 2023-09-06

### Fixed
Expand Down Expand Up @@ -92,7 +131,7 @@ No changes, just a re-release to fix a bad tag.

## v0.11.2 - 2023-07-21

- Add back-support for Wordpress 6.0 when testing.
- Add back-support for WordPress 6.0 when testing.

## v0.11.1 - 2023-05-31

Expand Down Expand Up @@ -207,7 +246,7 @@ No changes, just a re-release to fix a bad tag.
- Cast the item to an array inside of only_children.
- Adding keywords to trigger --dev.
- Separate requires based on what they include.
- Compatibility layer for Refresh_Database and Installs_Wordpress.
- Compatibility layer for Refresh_Database and Installs_WordPress.

## v0.6.1 - 2022-09-20

Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@
},
"require-dev": {
"alleyinteractive/alley-coding-standards": "^1.0.1",
"alleyinteractive/wp-match-blocks": "^1.0 || ^2.0 || ^3.0",
"guzzlehttp/guzzle": "^7.7",
"league/flysystem-aws-s3-v3": "^3.15",
"mockery/mockery": "^1.6.6",
"php-stubs/wp-cli-stubs": "^2.8",
"phpstan/phpdoc-parser": "^1.23.1",
"phpstan/phpstan": "1.10.32",
"phpunit/phpunit": "^9.6.10",
"phpstan/phpstan": "1.10.43",
"phpunit/phpunit": "^9.3.3",
"predis/predis": "^2.2.0",
"squizlabs/php_codesniffer": "^3.7",
"symplify/monorepo-builder": "^10.3.3",
Expand Down
1 change: 1 addition & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<exclude name="PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection" />
<exclude name="PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.Changed" />
<exclude name="Squiz.Commenting.FunctionComment.IncorrectTypeHint" />
<exclude name="Generic.Commenting.DocComment.MissingShort" />
</rule>

<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
Expand Down
18 changes: 18 additions & 0 deletions src/mantle/application/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,21 @@ function storage_path( string $path = '' ): string {
return app()->get_storage_path( $path );
}
}

if ( ! function_exists( 'now' ) ) {
/**
* Create a new Carbon instance for the current time.
*
* @todo Allow this to be faked and mocked during testing.
*
* @param DateTimeZone|string|null $tz Timezone.
* @return Carbon\Carbon
*/
function now( \DateTimeZone|string|null $tz = null ): Carbon\Carbon {
if ( ! $tz ) {
$tz = function_exists( 'wp_timezone' ) ? wp_timezone() : new DateTimeZone( 'UTC' );
}

return Carbon\Carbon::now( $tz );
}
}
2 changes: 1 addition & 1 deletion src/mantle/application/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mantle-framework/application",
"description": "The Mantle Framework Application Package",
"type": "project",
"type": "library",
"require": {
"php": "^8.0",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/assets/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mantle-framework/assets",
"description": "The Mantle Framework Asset Package",
"type": "project",
"type": "library",
"require": {
"php": "^8.0",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/auth/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mantle-framework/auth",
"description": "The Mantle Framework Auth Package",
"type": "project",
"type": "library",
"require": {
"php": "^8.0",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/blocks/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mantle-framework/blocks",
"description": "The Mantle Framework Blocks Package",
"type": "project",
"type": "library",
"require": {
"php": "^8.0",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/cache/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mantle-framework/cache",
"description": "The Mantle Framework Cache Package",
"type": "project",
"type": "library",
"require": {
"php": "^8.0",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/config/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mantle-framework/config",
"description": "The Mantle Framework Config Package",
"type": "project",
"type": "library",
"require": {
"php": "^8.0",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/console/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mantle-framework/console",
"description": "The Mantle Framework Console Package",
"type": "project",
"type": "library",
"require": {
"php": "^8.0",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/container/class-bound-method.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ protected static function get_call_reflector( $callback ) {
* Get the dependency for the given call parameter.
*
* @param Container $container Container instance.
* @param \ReflectionParameter $parameter Reflect Paramater.
* @param \ReflectionParameter $parameter Reflect Parameter.
* @param array $parameters Parameters to pass.
* @param array $dependencies Class dependencies.
* @return void
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/container/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mantle-framework/container",
"description": "The Mantle Framework Container Package",
"type": "project",
"type": "library",
"require": {
"php": "^8.0",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/contracts/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mantle-framework/contracts",
"description": "The Mantle Framework Contracts Package",
"type": "project",
"type": "library",
"require": {
"php": "^8.0",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/contracts/interface-application.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function booted( callable $callback ): static;
public function terminating( callable $callback ): static;

/**
* Termine the application.
* Terminate the application.
*
* @return void
*/
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/database/class-factory-service-provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function ( $app, $parameters ) {
$locale = config( 'app.faker_locale', Factory::DEFAULT_LOCALE );

if ( ! isset( static::$fakers[ $locale ] ) ) {
static::$fakers[ $locale ] = Factory::create();
static::$fakers[ $locale ] = Factory::create( $locale );

static::$fakers[ $locale ]->addProvider(
new Faker_Provider( static::$fakers[ $locale ] )
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/database/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mantle-framework/database",
"description": "The Mantle Framework Database Package",
"type": "project",
"type": "library",
"require": {
"php": "^8.0",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
Expand Down
9 changes: 6 additions & 3 deletions src/mantle/database/factory/class-attachment-factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
namespace Mantle\Database\Factory;

use Closure;
use Faker\Generator;
use Mantle\Contracts\Database\Core_Object;
use Mantle\Database\Model\Attachment;
use RuntimeException;
Expand All @@ -19,15 +18,19 @@
/**
* Attachment Factory
*
* @template TObject of \Mantle\Database\Model\Attachment
* @template TModel of \Mantle\Database\Model\Attachment
* @template TObject of \WP_Post
* @template TReturnValue
*
* @extends Factory<TModel, TObject, TReturnValue>
*/
class Attachment_Factory extends Post_Factory {
use Concerns\Generates_Images;

/**
* Model to use when creating objects.
*
* @var class-string
* @var class-string<TModel>
*/
protected string $model = Attachment::class;

Expand Down
8 changes: 6 additions & 2 deletions src/mantle/database/factory/class-blog-factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@
/**
* Blog Factory
*
* @template TObject of \Mantle\Database\Model\Site
* @template TModel of \Mantle\Database\Model\Site
* @template TObject of \WP_Site
* @template TReturnValue
*
* @extends Factory<TModel, TObject, TReturnValue>
*/
class Blog_Factory extends Factory {
/**
* Model to use when creating objects.
*
* @var class-string
* @var class-string<TModel>
*/
protected string $model = Site::class;

Expand Down
6 changes: 5 additions & 1 deletion src/mantle/database/factory/class-comment-factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
/**
* Term Factory
*
* @template TObject of \Mantle\Database\Model\Comment
* @template TModel of \Mantle\Database\Model\Comment
* @template TObject of \WP_Comment
* @template TReturnValue
*
* @extends Factory<TModel, TObject, TReturnValue>
*/
class Comment_Factory extends Factory {
/**
Expand Down
Loading

0 comments on commit 8b676c7

Please sign in to comment.