Skip to content
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

feat: drop support of php 7, use language level features of php 8, … #21

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/Tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis_install_dependencies.sh export-ignore
/.travis.yml export-ignore
/phpstan-config.neon export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
99 changes: 99 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# .github/workflows/ci.yaml
name: CI

on: ["push", "pull_request"]

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.2']
stability: [ prefer-stable ]
symfony-version: ['6.3.*']
include:
- php: '8.1'
symfony-version: 5.4.*
stability: prefer-lowest
- php: '8.1'
symfony-version: 5.4.*
stability: prefer-stable
- php: '8.1'
symfony-version: 6.3.*
stability: prefer-stable
- php: '8.2'
symfony-version: 6.3.*
stability: prefer-stable

# Docker Hub image that `postgres-job` executes in
container: node:latest

# service containers to run with `postgres-job`
services:

# https://docs.github.com/en/actions/using-containerized-services/creating-postgresql-service-containers
postgres:
# Docker Hub image
image: postgres:latest
# service environment variables
env:
POSTGRES_HOST: 'localhost'
POSTGRES_DB: test
POSTGRES_PASSWORD: root
POSTGRES_PORT: 5432
POSTGRES_USER: root
ports:
- 5432:5432
# set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

# https://atlasgo.io/guides/testing/github-actions
mysql:
image: mysql:8.0.29
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
ports:
- "3306:3306"
options: >-
--health-cmd "mysqladmin ping -proot"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10


name: PHP ${{ matrix.php }} - ${{ matrix.symfony-version }} - ${{ matrix.stability }}
steps:

# basically git clone
- uses: actions/checkout@v3

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

# use PHP of specific version
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: pcov, pdo, pdo_mysql, pdo_pgsql
coverage: pcov

- name: Install dependencies
env:
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
run: |
composer update --no-interaction --prefer-dist

- name: Execute tests
env:
SYMFONY_DEPRECATIONS_HELPER: 'weak'
run: vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/phpstan.neon
/phpunit.xml
/vendor
/var/cache
77 changes: 0 additions & 77 deletions .travis.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .travis_install_dependencies.sh

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [2.0.0] – 2022-xx

- added strong php types
- dropped support for Php 7
- dropped support for Symfony 5.3
- drop support of doctrine/persistence v2

[2.0.0]: https://github.com/craue/CraueGeoBundle/compare/1.9.0...2.0.0

## [1.9.0] – 2022-01-24

- added support for PHP 8.0
Expand Down
8 changes: 3 additions & 5 deletions CraueGeoBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ class CraueGeoBundle extends Bundle {
/**
* {@inheritDoc}
*/
public function build(ContainerBuilder $container) {
public function build(ContainerBuilder $container): void {
parent::build($container);
$this->addRegisterMappingsPass($container);
}

/**
* @param ContainerBuilder $container
*/
private function addRegisterMappingsPass(ContainerBuilder $container) {
private function addRegisterMappingsPass(ContainerBuilder $container): void
{
$mappings = [
realpath(__DIR__ . '/Resources/config/doctrine-mapping') => 'Craue\GeoBundle\Entity',
];
Expand Down
6 changes: 3 additions & 3 deletions DependencyInjection/CraueGeoExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class CraueGeoExtension extends Extension implements PrependExtensionInterface {
/**
* {@inheritDoc}
*/
public function load(array $config, ContainerBuilder $container) {
public function load(array $configs, ContainerBuilder $container): void {
}

/**
* {@inheritDoc}
*/
public function prepend(ContainerBuilder $container) {
*/
public function prepend(ContainerBuilder $container): void {
$config = $this->processConfiguration(new Configuration(), $container->getExtensionConfig($this->getAlias()));

if ($config['enable_postal_code_entity'] === true) {
Expand Down
Loading