Skip to content

Commit

Permalink
Update boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
olvlvl committed Nov 19, 2024
1 parent 58de985 commit 66e672d
Show file tree
Hide file tree
Showing 25 changed files with 158 additions and 254 deletions.
8 changes: 7 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@ insert_final_newline = true
indent_style = space
indent_size = 4

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

[*.md]
max_line_length = 100

[{Dockerfile,Makefile}]
indent_style = tab
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.phpunit.cache
.phpunit.result.cache
build
composer.lock
vendor
2 changes: 1 addition & 1 deletion MIGRATION.md → CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### New Requirements

- PHP 8.1+
- PHP 8.2+

### New features

Expand Down
56 changes: 34 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
ARG PHP_VERSION
FROM php:${PHP_VERSION}-cli-buster
ARG PHP_VERSION=8.2
FROM php:${PHP_VERSION}-cli-bookworm

RUN apt-get update && \
apt-get install -y autoconf pkg-config && \
pecl channel-update pecl.php.net && \
pecl install xdebug && \
docker-php-ext-enable opcache xdebug
RUN <<-EOF
docker-php-ext-enable opcache

RUN echo '\
xdebug.client_host=host.docker.internal\n\
xdebug.mode=develop\n\
xdebug.start_with_request=yes\n\
' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
if [ "$PHP_VERSION" \< "8.4" ]; then
apt-get update
apt-get install -y autoconf pkg-config
pecl channel-update pecl.php.net
pecl install xdebug
docker-php-ext-enable xdebug
fi
EOF

RUN echo '\
display_errors=On\n\
error_reporting=E_ALL\n\
date.timezone=UTC\n\
' >> /usr/local/etc/php/conf.d/php.ini
RUN <<-EOF
cat <<-SHELL >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
xdebug.client_host=host.docker.internal
xdebug.mode=develop
xdebug.start_with_request=yes
SHELL

cat <<-SHELL >> /usr/local/etc/php/conf.d/php.ini
display_errors=On
error_reporting=E_ALL
date.timezone=UTC
SHELL
EOF

ENV COMPOSER_ALLOW_SUPERUSER 1

RUN apt-get update && \
apt-get install unzip && \
curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet && \
mv composer.phar /usr/local/bin/composer && \
echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"\n' >> /root/.bashrc
RUN <<-EOF
apt-get update
apt-get install unzip
curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet
mv composer.phar /usr/local/bin/composer
cat <<-SHELL >> /root/.bashrc
export PATH="$HOME/.composer/vendor/bin:$PATH"
SHELL
EOF

RUN composer global require squizlabs/php_codesniffer
43 changes: 17 additions & 26 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
icanboogie/bind-activerecord is free software.
It is released under the terms of the following BSD License.
MIT License

Copyright (c) 2015-present by Olivier Laviale
All rights reserved.
Copyright (c) 2015 Olivier LAVIALE <olivier.laviale@gmail.com>

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of Olivier Laviale nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
19 changes: 7 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
# customization

PACKAGE_NAME = icanboogie/bind-activerecord
PHPUNIT = vendor/bin/phpunit

# do not edit the following lines

.PHONY: usage
usage:
@echo "test: Runs the test suite.\ndoc: Creates the documentation.\nclean: Removes the documentation, the dependencies and the Composer files."

vendor:
@composer install

Expand All @@ -19,7 +14,7 @@ test-dependencies: vendor test-cleanup

.PHONY: test
test: test-dependencies
@$(PHPUNIT)
@$(PHPUNIT) $(ARGS)

.PHONY: test-coverage
test-coverage: test-dependencies
Expand All @@ -36,18 +31,18 @@ test-cleanup:
@# nothing

.PHONY: test-container
test-container: test-container-81

.PHONY: test-container-81
test-container-81:
@-docker-compose run --rm app81 bash
@docker-compose down -v
test-container: test-container-82

.PHONY: test-container-82
test-container-82:
@-docker-compose run --rm app82 bash
@docker-compose down -v

.PHONY: test-container-84
test-container-84:
@-docker-compose run --rm app84 bash
@docker-compose down -v

.PHONY: lint
lint:
@XDEBUG_MODE=off phpcs -s
Expand Down
26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# bind-activerecord

[![Packagist](https://img.shields.io/packagist/v/icanboogie/bind-activerecord.svg)](https://packagist.org/packages/icanboogie/bind-activerecord)
[![Code Quality](https://img.shields.io/scrutinizer/g/ICanBoogie/bind-activerecord.svg)](https://scrutinizer-ci.com/g/ICanBoogie/bind-activerecord)
[![Code Coverage](https://img.shields.io/coveralls/ICanBoogie/bind-activerecord.svg)](https://coveralls.io/r/ICanBoogie/bind-activerecord)
[![Release](https://img.shields.io/packagist/v/icanboogie/bind-activerecord.svg)](https://packagist.org/packages/icanboogie/bind-activerecord)
[![Code Coverage](https://coveralls.io/repos/github/ICanBoogie/bind-activerecord/badge.svg?branch=6.0)](https://coveralls.io/r/ICanBoogie/bind-activerecord?branch=6.0)
[![Downloads](https://img.shields.io/packagist/dt/icanboogie/bind-activerecord.svg)](https://packagist.org/packages/icanboogie/bind-activerecord)

The **icanboogie/bind-activerecord** package binds the [icanboogie/activerecord][] package to
Expand Down Expand Up @@ -39,7 +38,7 @@ $nodes = $app->service_for_class(ModelProvider::class)->model_for_record(Node::c

#### Installation

```bash
```shell
composer require icanboogie/bind-activerecord
```

Expand Down Expand Up @@ -105,31 +104,22 @@ return fn(ConfigBuilder $config) => $config

The project is continuously tested by [GitHub actions](https://github.com/ICanBoogie/bind-activerecord/actions).

[![Tests](https://github.com/ICanBoogie/activerecord/workflows/test/badge.svg?branch=master)](https://github.com/ICanBoogie/activerecord/actions?query=workflow%3Atest)
[![Static Analysis](https://github.com/ICanBoogie/activerecord/workflows/static-analysis/badge.svg?branch=master)](https://github.com/ICanBoogie/ActiveRecord/actions?query=workflow%3Astatic-analysis)
[![Code Style](https://github.com/ICanBoogie/activerecord/workflows/code-style/badge.svg?branch=master)](https://github.com/ICanBoogie/activerecord/actions?query=workflow%3Acode-style)
[![Tests](https://github.com/ICanBoogie/bind-activerecord/actions/workflows/test.yml/badge.svg?branch=6.0)](https://github.com/ICanBoogie/bind-activerecord/actions/workflows/test.yml)
[![Static Analysis](https://github.com/ICanBoogie/bind-activerecord/actions/workflows/static-analysis.yml/badge.svg?branch=6.0)](https://github.com/ICanBoogie/bind-activerecord/actions/workflows/static-analysis.yml)
[![Code Style](https://github.com/ICanBoogie/bind-activerecord/actions/workflows/code-style.yml/badge.svg?branch=6.0)](https://github.com/ICanBoogie/bind-activerecord/actions/workflows/code-style.yml)



## Code of Conduct

This project adheres to a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in
this project and its community, you are expected to uphold this code.
this project and its community, you're expected to uphold this code.



## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.



## License

**icanboogie/bind-activerecord** is released under the [BSD-3-Clause](LICENSE).



See [CONTRIBUTING](CONTRIBUTING.md) for details.



Expand Down
105 changes: 52 additions & 53 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,54 @@
{
"name": "icanboogie/bind-activerecord",
"type": "library",
"description": "Binds ActiveRecord to ICanBoogie",
"homepage": "https://icanboogie.org/",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Olivier Laviale",
"email": "olivier.laviale@gmail.com",
"homepage": "https://olvlvl.com/",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/ICanBoogie/bind-activerecord/issues",
"source": "https://github.com/ICanBoogie/bind-activerecord"
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"prefer-dist": true,
"require": {
"php": ">=8.1",
"icanboogie/activerecord": "^6.0",
"icanboogie/icanboogie": "^6.0"
},
"require-dev": {
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.0"
},
"autoload": {
"psr-4": {
"ICanBoogie\\Binding\\ActiveRecord\\": "lib"
}
},
"autoload-dev": {
"psr-4": {
"Test\\ICanBoogie\\Binding\\ActiveRecord\\": "tests/lib"
}
},
"extra": {
"icanboogie": {
"config-constructor": {
"ICanBoogie\\ActiveRecord\\Config": "ICanBoogie\\Binding\\ActiveRecord\\ConfigBuilder"
},
"config-path": "config"
}
},
"scripts": {
"post-autoload-dump": "ICanBoogie\\Autoconfig\\Hooks::on_autoload_dump"
}
"name": "icanboogie/bind-activerecord",
"type": "library",
"description": "Binds ActiveRecord to ICanBoogie",
"homepage": "https://icanboogie.org/",
"license": "MIT",
"authors": [
{
"name": "Olivier Laviale",
"email": "olivier.laviale@gmail.com",
"homepage": "https://olvlvl.com/",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/ICanBoogie/bind-activerecord/issues",
"source": "https://github.com/ICanBoogie/bind-activerecord"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"icanboogie/autoconfig": true
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.2",
"icanboogie/activerecord": "^6.0",
"icanboogie/icanboogie": "^6.0"
},
"require-dev": {
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^11.4"
},
"autoload": {
"psr-4": {
"ICanBoogie\\Binding\\ActiveRecord\\": "lib"
}
},
"autoload-dev": {
"psr-4": {
"Test\\ICanBoogie\\Binding\\ActiveRecord\\": "tests/lib"
}
},
"extra": {
"icanboogie": {
"config-constructor": {
"ICanBoogie\\ActiveRecord\\Config": "ICanBoogie\\Binding\\ActiveRecord\\ConfigBuilder"
},
"config-path": "config"
}
}
}
21 changes: 10 additions & 11 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
---
version: "3.2"
services:
app81:
app82:
build:
context: .
args:
PHP_VERSION: 8.1
PHP_VERSION: "8.2"
environment:
PHP_IDE_CONFIG: 'serverName=icanboogie-bind-activerecord'
PHP_IDE_CONFIG: 'serverName=icanboogie-bind-activerecord'
volumes:
- .:/app:delegated
- ~/.composer:/root/.composer:delegated
- .:/app:delegated
- ~/.composer:/root/.composer:delegated
working_dir: /app
app82:
app84:
build:
context: .
args:
PHP_VERSION: 8.2
PHP_VERSION: "8.4.0RC4"
environment:
PHP_IDE_CONFIG: 'serverName=icanboogie-bind-activerecord'
PHP_IDE_CONFIG: 'serverName=icanboogie-bind-activerecord'
volumes:
- .:/app:delegated
- ~/.composer:/root/.composer:delegated
- .:/app:delegated
- ~/.composer:/root/.composer:delegated
working_dir: /app
Loading

0 comments on commit 66e672d

Please sign in to comment.