Skip to content

v2 #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Dec 14, 2024
Merged

v2 #21

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -9,4 +9,11 @@ updates:
schedule:
interval: "weekly"
labels:
- "dependencies"
- "dependencies"

- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
7 changes: 4 additions & 3 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -8,22 +8,23 @@ permissions:
jobs:
dependabot:
runs-on: ubuntu-latest
timeout-minutes: 5
if: ${{ github.actor == 'dependabot[bot]' }}
steps:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2.2.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Auto-merge Dependabot PRs for semver-minor updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Auto-merge Dependabot PRs for semver-patch updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --merge "$PR_URL"
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
name: Check & fix styling
name: Fix PHP code style issues

on: [push]
on:
push:
paths:
- '**.php'

permissions:
contents: write

jobs:
php-cs-fixer:
php-code-styling:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs.dist.php --allow-risky=yes
- name: Fix PHP code style issues
uses: aglipanci/laravel-pint-action@2.4

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
4 changes: 3 additions & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -5,18 +5,20 @@ on:
paths:
- '**.php'
- 'phpstan.neon.dist'
- '.github/workflows/phpstan.yml'

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.4'
coverage: none

- name: Install composer dependencies
32 changes: 19 additions & 13 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -2,25 +2,28 @@ name: run-tests

on:
push:
branches: [main]
pull_request:
branches: [main]
paths:
- '**.php'
- '.github/workflows/run-tests.yml'
- 'phpunit.xml.dist'
- 'composer.json'
- 'composer.lock'

jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: ["8.0", "8.1"]
laravel: [8.*, 9.*]
stability: [prefer-stable]
os: [ubuntu-latest]
php: [8.4, 8.3]
laravel: [11.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 8.*
testbench: 6.*
- laravel: 11.*
testbench: 9.*
carbon: ^2.63

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

@@ -42,8 +45,11 @@ jobs:

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.os == 'windows-latest' && '^^^' || '' }}${{ matrix.carbon }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: List Installed Dependencies
run: composer show -D

- name: Execute tests
run: vendor/bin/pest
run: vendor/bin/pest --ci
4 changes: 4 additions & 0 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -4,9 +4,13 @@ on:
release:
types: [released]

permissions:
contents: write

jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout code
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -12,3 +12,5 @@ testbench.yaml
vendor
node_modules
.php-cs-fixer.cache
test-results
.phpunit.cache
40 changes: 0 additions & 40 deletions .php_cs.dist.php

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) Petrobolos Games <info@petrobolos.com>
Copyright (c) Oliver Earl <oliver.earl@petrobolos.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -14,8 +14,7 @@ large sets of data.

## Requirements

Currently, requires PHP 8 or above, but work to backport support for 7.4 is in progress. This package is designed
for Laravel 8 and 9, but might play nicely with older versions, or with Lumen. Let us know.
Currently, requires PHP 8.3 or above, and Laravel 11+.

## Installation

@@ -110,9 +109,6 @@ $everything = FixedArray::merge(
| toArray | Converts a fixed array into a standard array. | `FixedArray::toArray($array)` |
| toCollection | Converts a fixed array into an Illuminate collection. | `FixedArray::toCollection($array)` |

**NB:** Methods `current`, `key`, `next`, `rewind`, and `valid` are legacy alias operations for pointer-based array
methods and simply return `null` currently. They will be implemented in a future version.

## Testing

Tests are run using Pest. You can run the suite like so:
45 changes: 27 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "petrobolos/fixed-array-functions",
"description": "This is my package fixed-array-functions",
"description": "Laravel helper methods for working with high performance SPL fixed arrays.",
"keywords": [
"laravel",
"splfixedarray",
"array",
"collection"
],
"homepage": "https://github.com/petrobolos/fixed-array-functions",
"homepage": "https://github.com/oliverearl/fixed-array-functions",
"license": "MIT",
"authors": [
{
@@ -17,38 +17,44 @@
}
],
"require": {
"php": "^8.0 || ^8.1",
"spatie/laravel-package-tools": "^1.9.2",
"illuminate/contracts": "^8.0 || ^9.0"
"php": "^8.3",
"spatie/laravel-package-tools": "^1.16",
"illuminate/contracts": "^11.0"
},
"require-dev": {
"nunomaduro/collision": "^5.0 || ^6.0",
"nunomaduro/larastan": "^1.0.3 || ^2.0.1",
"orchestra/testbench": "^6.0 || ^7.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5"
"laravel/pint": "^1.14",
"nunomaduro/collision": "^8.1.1",
"larastan/larastan": "^2.9",
"orchestra/testbench": "^9.0.0",
"pestphp/pest": "^3.0",
"pestphp/pest-plugin-arch": "^3.0",
"pestphp/pest-plugin-laravel": "^3.0",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpstan/phpstan-phpunit": "^1.3",
"spatie/laravel-ray": "^1.35"
},
"autoload": {
"psr-4": {
"Petrobolos\\FixedArray\\": "src"
"Petrobolos\\FixedArray\\": "src/"
},
"files": [
"src/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"Petrobolos\\FixedArray\\Tests\\": "tests"
"Petrobolos\\FixedArray\\Tests\\": "tests",
"Workbench\\App\\": "workbench/app/"
}
},
"scripts": {
"post-autoload-dump": "@composer run prepare",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"analyse": "vendor/bin/phpstan analyse",
"test": "vendor/bin/pest",
"test-coverage": "vendor/bin/pest --coverage"
"test-coverage": "vendor/bin/pest --coverage",
"format": "vendor/bin/pint"
},
"config": {
"sort-packages": true,
@@ -61,7 +67,10 @@
"laravel": {
"providers": [
"Petrobolos\\FixedArray\\FixedArrayFunctionsServiceProvider"
]
],
"aliases": {
"FixedArray": "Petrobolos\\FixedArrayFunctions\\Facades\\FixedArray"
}
}
},
"minimum-stability": "dev",
4 changes: 1 addition & 3 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -2,11 +2,9 @@ includes:
- phpstan-baseline.neon

parameters:
level: 4
level: 5
paths:
- src
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
checkMissingIterableValueType: false

Loading
Loading