Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
Support Laravel 10 (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
tspencer244 authored Sep 26, 2023
1 parent 82f23d6 commit 4d3bc07
Show file tree
Hide file tree
Showing 39 changed files with 385 additions and 203 deletions.
52 changes: 52 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: 2.1

executors:
php81:
docker:
- image: cimg/php:8.1
resource_class: small
php82:
docker:
- image: cimg/php:8.2
resource_class: small

jobs:
analyse:
executor: php82
steps:
- checkout
- run: composer update
- run: composer analyse
coverage:
executor: php82
steps:
- run: sudo pecl install pcov
- checkout
- run: composer update
- run: composer coverage
lint:
executor: php82
steps:
- checkout
- run: composer update
- run: composer lint
test:
parameters:
php_executor:
type: string
executor: << parameters.php_executor >>
steps:
- checkout
- run: composer update
- run: composer test

workflows:
analyse_lint_test_coverage:
jobs:
- analyse
- coverage
- lint
- test:
matrix:
parameters:
php_executor: [php81, php82]
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ max_line_length = 120
[*.{md,diff}]
trim_trailing_whitespace = false

[*.json]
[*.{json,neon,yaml,yml}]
indent_size = 2

[*.{yaml,yml}]
indent_size = 2
[composer.json]
indent_size = 4
23 changes: 4 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
# composer
/.idea/
/.php-cs-fixer.cache
/.phpunit.cache/
/composer.lock
/vendor/
composer.lock

# tests
phpunit.xml
clover.xml
coverage*
.phpunit.result.cache

# system
.DS_Store

# editors
.idea
*.swp

# lint
.php_cs.cache
.php_cs
10 changes: 10 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

return (new Config())
->setFinder((new Finder())->in(__DIR__))
->setRules(['@PSR12' => true]);
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Changelog

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).

## [Unreleased]

## [v2.0.0] - 2023-09-22

### Added

- Added support for Laravel 10.

### Changed

- Changed the `HealthEngine` namespace to `Healthengine`.

### Removed

- Removed support for Laravel 6.
- Removed support for Laravel 7.
- Removed support for Laravel 8.
- Removed support for Laravel 9.

## [v1.0.0] - 2021-06-10

## [v0.5.0] - 2021-05-21

## [v0.4.1] - 2021-04-07

## [v0.3.0] - 2021-04-07

## [v0.2.0] - 2021-04-07

## [v0.1.0] - 2021-04-07

[unreleased]: https://github.com/HealthEngineAU/laravel-i18n/compare/v2.0.0...HEAD
[v2.0.0]: https://github.com/HealthEngineAU/laravel-i18n/compare/1.0.0...v2.0.0
[v1.0.0]: https://github.com/HealthEngineAU/laravel-i18n/compare/0.5.0...1.0.0
[v0.5.0]: https://github.com/HealthEngineAU/laravel-i18n/compare/0.4.1...0.5.0
[v0.4.1]: https://github.com/HealthEngineAU/laravel-i18n/compare/0.3.0...0.4.1
[v0.3.0]: https://github.com/HealthEngineAU/laravel-i18n/compare/0.2.0...0.3.0
[v0.2.0]: https://github.com/HealthEngineAU/laravel-i18n/compare/0.1.0...0.2.0
[v0.1.0]: https://github.com/HealthEngineAU/laravel-i18n/releases/tag/0.1.0
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Laravel I18n

[![CircleCI](https://dl.circleci.com/status-badge/img/gh/HealthEngineAU/laravel-i18n/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/HealthEngineAU/laravel-i18n/tree/main)

This is a custom package designed for Laravel Eloquent. It provides helpers used to manage flat JSON files for
localisation.

Expand Down
6 changes: 6 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Upgrade

## From 1.x to 2.x

- Replace `HealthEngine\I18n` references with `Healthengine\I18n`.
- Be prepared for invalid configuration/translation files to start throwing exceptions.
47 changes: 25 additions & 22 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,55 @@
"license": "MIT",
"authors": [
{
"name": "Reece Como",
"email": "reece.como@healthengine.com.au"
"name": "Thomas Spencer",
"email": "thomas.spencer@healthengine.com.au"
}
],
"require": {
"illuminate/support": "~6.0|>=7.0",
"php": "~8.1.0 || ~8.2.0",
"ext-json": "*",
"ext-mbstring": "*"
"ext-mbstring": "*",
"laravel/framework": "^10.0"
},
"require-dev": {
"phpunit/phpunit": "^7.5 || ^8.0 || ^9.0",
"orchestra/testbench": "^3.7 || ^4.0 || ^5.0 || ^6.0",
"phpstan/phpstan": "^0.12.83",
"phpstan/phpstan-strict-rules": "^0.12.9",
"squizlabs/php_codesniffer": "^3.5"
"friendsofphp/php-cs-fixer": "^3.27",
"orchestra/testbench": "^8.11",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-strict-rules": "^1.5",
"phpunit/phpunit": "^10.3"
},
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"HealthEngine\\I18n\\": "src/"
"Healthengine\\I18n\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"HealthEngine\\I18n\\Tests\\": "tests/"
"Healthengine\\I18n\\Tests\\": "tests/"
}
},
"scripts": {
"test": [
"composer validate",
"@lint",
"@phpstan",
"@phpunit"
],
"phpstan": "@php vendor/bin/phpstan",
"phpunit": "@php vendor/bin/phpunit --colors=always",
"lint": "@php vendor/bin/phpcs src",
"fix": "@php vendor/bin/phpcbf src"
"analyse": "@php vendor/bin/phpstan",
"coverage": "@php vendor/bin/phpunit --colors=always --coverage-text",
"lint": "@php vendor/bin/php-cs-fixer fix --diff --dry-run",
"fix": "@php vendor/bin/php-cs-fixer fix",
"test": "@php vendor/bin/phpunit --colors=always"
},
"extra": {
"laravel": {
"providers": [
"HealthEngine\\I18n\\TranslationServiceProvider"
"Healthengine\\I18n\\TranslationServiceProvider"
]
}
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
},
"sort-packages": true
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 0 additions & 26 deletions phpcs.xml

This file was deleted.

6 changes: 6 additions & 0 deletions phpstan.dist.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
level: 9
paths:
- src
stubFiles:
- stubs/Illuminate_Contracts_Translation_Translator.stub
8 changes: 0 additions & 8 deletions phpstan.neon

This file was deleted.

27 changes: 27 additions & 0 deletions phpunit.dist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
executionOrder="depends,defects"
requireCoverageMetadata="true"
beStrictAboutCoverageMetadata="true"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true">
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
<directory>src</directory>
</include>
</source>
</phpunit>
35 changes: 0 additions & 35 deletions phpunit.xml.dist

This file was deleted.

2 changes: 1 addition & 1 deletion src/Contracts/I18nTranslator.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace HealthEngine\I18n\Contracts;
namespace Healthengine\I18n\Contracts;

use Illuminate\Contracts\Translation\Translator;

Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/LanguageDetector.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace HealthEngine\I18n\Contracts;
namespace Healthengine\I18n\Contracts;

use Illuminate\Http\Request;

Expand Down
4 changes: 2 additions & 2 deletions src/Http/Middleware/AcceptLanguage.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace HealthEngine\I18n\Http\Middleware;
namespace Healthengine\I18n\Http\Middleware;

use HealthEngine\I18n\Http\Middleware\Detectors\HeaderDetector;
use Healthengine\I18n\Http\Middleware\Detectors\HeaderDetector;

final class AcceptLanguage extends DetectLanguage
{
Expand Down
Loading

0 comments on commit 4d3bc07

Please sign in to comment.