Skip to content
Merged
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
12 changes: 5 additions & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Ignore all test and documentation for archive
/.github export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
.* export-ignore
*.dist export-ignore
*.neon export-ignore
*.yml export-ignore
/tests export-ignore
/docs export-ignore
/Makefile export-ignore
19 changes: 0 additions & 19 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

6 changes: 0 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

30 changes: 14 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
name: build

push:
on:
pull_request: &ignore-paths
paths-ignore:
- 'docs/**'
- '.github/CONTRIBUTING.md'
- '.github/FUNDING.yml'
- '.github/SECURITY.md'
- 'README.md'
- 'CHANGELOG.md'
- 'LICENSE.md'
- '.gitignore'
- '.gitattributes'
- '.editorconfig'
- 'docker-compose.yml'
- 'Makefile'

name: build
push: *ignore-paths

jobs:
phpunit:
uses: yiisoft/actions/.github/workflows/phpunit.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
uses: yiisoft/yii2-actions/.github/workflows/phpunit.yml@master
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: linter

permissions:
contents: read

on:
pull_request: &ignore-paths
paths-ignore:
- 'docs/**'
- '.github/CONTRIBUTING.md'
- '.github/FUNDING.yml'
- '.github/SECURITY.md'
- 'README.md'
- 'CHANGELOG.md'
- 'LICENSE.md'
- '.gitignore'
- '.gitattributes'
- '.editorconfig'
- 'docker-compose.yml'
- 'Makefile'

push: *ignore-paths

jobs:
phpcs:
uses: yiisoft/yii2-actions/.github/workflows/linter.yml@master
with:
directories: src/ tests/
26 changes: 26 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: static analysis

permissions:
contents: read

on:
pull_request: &ignore-paths
paths-ignore:
- 'docs/**'
- '.github/CONTRIBUTING.md'
- '.github/FUNDING.yml'
- '.github/SECURITY.md'
- 'README.md'
- 'CHANGELOG.md'
- 'LICENSE.md'
- '.gitignore'
- '.gitattributes'
- '.editorconfig'
- 'docker-compose.yml'
- 'Makefile'

push: *ignore-paths

jobs:
phpstan:
uses: yiisoft/yii2-actions/.github/workflows/phpstan.yml@master
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ composer.phar
phpunit.phar
# local phpunit config
/phpunit.xml
.phpunit.result.cache
coverage.xml

/tests/runtime
/tests/data/config.local.php
/tests/docker
/tests/dockerids

5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Yii Framework 2 bootstrap extension Change Log
==============================================

2.0.12 under development
3.0.0 under development
------------------------

- no changes in this release.
- Enh #281: Applying Yii2 coding standards (@s1lver)
- Enh #281: Raise min version to PHP 7.4 (@s1lver)


2.0.11 August 09, 2021
Expand Down
38 changes: 18 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
help: ## Display help information.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'

# default versions to test against
# these can be overridden by setting the environment variables in the shell
PHP_VERSION=php-5.6.8
YII_VERSION=dev-master
start: ## Start services
docker compose up -d

# ensure all the configuration variables above are in environment of the shell commands below
export
test: ## Run tests. Params: {{ v=8.1 }}.
PHP_VERSION=$(filter-out $@,$(v)) docker compose up -d --build
docker exec yii2-bootstrap-php-1 sh -c "php -v && composer update && vendor/bin/phpunit --coverage-clover=coverage.xml"
make down

help:
@echo "make test - run phpunit tests using a docker environment"
# @echo "make clean - stop docker and remove container"
build: ## Build an image from a docker-compose file. Params: {{ v=8.1 }}.
PHP_VERSION=$(filter-out $@,$(v)) docker compose up -d --build

test: docker-php
composer require "yiisoft/yii2:${YII_VERSION}" --prefer-dist
composer install --prefer-dist
docker run --rm=true -v $(shell pwd):/opt/test yiitest/php:${PHP_VERSION} phpunit --verbose --color
down: ## Stop and remove containers, networks
docker compose down

docker-php: dockerfiles
cd tests/docker/php && sh build.sh

dockerfiles:
test -d tests/docker || git clone https://github.com/cebe/jenkins-test-docker tests/docker
cd tests/docker && git checkout -- . && git pull
mkdir -p tests/dockerids
sh: ## Enter the container with the application
docker exec -it yii2-bootstrap-php-1 bash

static-analysis: ## Run code static analyze. Params: {{ v=8.1 }}.
make build v=$(filter-out $@,$(v))
docker exec yii2-bootstrap-php-1 sh -c "php -v && composer update && vendor/bin/phpstan analyse --memory-limit 512M"
make down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ Documentation is at [docs/guide/README.md](docs/guide/README.md).
[![Latest Stable Version](https://poser.pugx.org/yiisoft/yii2-bootstrap/v/stable.png)](https://packagist.org/packages/yiisoft/yii2-bootstrap)
[![Total Downloads](https://poser.pugx.org/yiisoft/yii2-bootstrap/downloads.png)](https://packagist.org/packages/yiisoft/yii2-bootstrap)
[![Build Status](https://github.com/yiisoft/yii2-bootstrap/workflows/build/badge.svg)](https://github.com/yiisoft/yii2-bootstrap/actions)
[![codecov](https://codecov.io/gh/yiisoft/yii2-bootstrap/graph/badge.svg)](https://codecov.io/gh/yiisoft/yii2-bootstrap)


Installation
------------

> [!IMPORTANT]
> - The minimum required [PHP](https://www.php.net/) version is PHP `7.4`.
> - It works best with PHP `8`.

The preferred way to install this extension is through [composer](https://getcomposer.org/download/).

Either run
Expand Down
19 changes: 6 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@
}
],
"require": {
"yiisoft/yii2": "~2.0.6",
"php": ">=7.4",
"yiisoft/yii2": "^2.0.54",
"bower-asset/bootstrap": "3.4.* | 3.3.* | 3.2.* | 3.1.*"
},
"require-dev": {
"cweagans/composer-patches": "^1.7",
"phpunit/phpunit": "4.8.34"
"yiisoft/yii2-coding-standards": "~3.0",
"phpunit/phpunit": "^9.6",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-phpunit": "^2.0"
},
"repositories": [
{
Expand All @@ -53,20 +56,10 @@
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
},
"patches": {
"phpunit/phpunit-mock-objects": {
"Fix PHP 7 and 8 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_mock_objects.patch"
},
"phpunit/phpunit": {
"Fix PHP 7 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php7.patch",
"Fix PHP 8 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php8.patch"
}
}
},
"config": {
"allow-plugins": {
"cweagans/composer-patches": true,
"yiisoft/yii2-composer": true
}
}
Expand Down
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---

services:

php:
image: "yiisoftware/yii2-php:${PHP_VERSION:-8.1}-apache"
networks:
- yii2-bootstrap
volumes:
- .:/app # Mount source-code for development
environment:
XDEBUG_MODE: ${XDEBUG_MODE:-coverage} # Setup "debug" to enable debugging
XDEBUG_CONFIG: "client_host=host.docker.internal"
XDEBUG_TRIGGER: ${XDEBUG_TRIGGER:-yes}
command: >
bash -c "
docker-php-ext-enable xdebug;
apache2-foreground"

networks:
yii2-bootstrap:
driver: bridge
name: yii2-bootstrap
14 changes: 14 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Yii2">
<rule ref="vendor/yiisoft/yii2-coding-standards/Yii2"></rule>

<!-- generate relative paths -->
<arg name="basepath" value="src"/>

<rule ref="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore">
<exclude-pattern>/*\.php$</exclude-pattern>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<exclude-pattern>/tests/ToggleButtonGroupTest\.php$</exclude-pattern>
</rule>
</ruleset>
Loading
Loading