diff --git a/.travis.yml b/.travis.yml index 6119342..d0c7373 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,13 +2,15 @@ language: php php: - '5.6' - '7.0' + - '7.1' env: - - SYMFONY_VERSION=2.3.* - SYMFONY_VERSION=2.7.* - SYMFONY_VERSION=2.8.* - SYMFONY_VERSION=3.0.* - SYMFONY_VERSION=3.1.* + - SYMFONY_VERSION=3.2.* + - SYMFONY_VERSION=3.3.* before_script: - composer self-update diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..cdc343d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Change Log +All notable changes to this project will be documented in this file based on the [Keep a Changelog](http://keepachangelog.com/) Standard. +This project adheres to [Semantic Versioning](http://semver.org/). + +## [Unreleased](https://github.com/gbprod/algolia-specification-bundle/compare/v1.0.0...HEAD) + +## [v1.0.0](https://github.com/gbprod/algolia-specification-bundle/compare/v0.1.0...v1.0.0) + + - Add changelog + - Add contributing file + - Update dependencies to stable + - Drop php5.5 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3fa8f74 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,29 @@ +# Contributing + +Thank you for taking time to help. + + * Code contributions must be done in respect of [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md). Scrutinizer will validate this. + * All changes must be documented in the [CHANGELOG.md](https://github.com/gbprod/algolia-specification-bundle/blob/master/CHANGELOG.md) in respect of [Keep a Changelog](http://keepachangelog.com/) Standard. + * Please create an issue before creating a pull request. + * All code must be covered by tests. + * Pull requests are made to master. Changes are never pushed directly (without pull request) into master. + * Use a feature branch for every pull request. Don't open a pull request from your master branch. + +## Setup + +You should have `php >= 7.0` and `composer` installed (Docker contribution is very welcomed). + +Setup you're environment: +```bash +make install +``` + +Run tests: +```bash +make test-unit +``` + +Coverage: +```bash +make test-coverage +``` diff --git a/Makefile b/Makefile index 4359a0b..cc2697f 100644 --- a/Makefile +++ b/Makefile @@ -1,41 +1,18 @@ -.SILENT: -.PHONY: help +.PHONY: install test-unit test-coverage -## Colors -COLOR_RESET = \033[0m -COLOR_INFO = \033[32m -COLOR_COMMENT = \033[33m +PHP?=php +COMPOSER?=composer -## Help -help: - printf "${COLOR_COMMENT}Usage:${COLOR_RESET}\n" - printf " make \n\n" - printf "${COLOR_COMMENT}Available targets:${COLOR_RESET}\n" - awk '/^[a-zA-Z\-\_0-9\.@]+:/ { \ - helpMessage = match(lastLine, /^## (.*)/); \ - if (helpMessage) { \ - helpCommand = substr($$1, 0, index($$1, ":")); \ - helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \ - printf " ${COLOR_INFO}%-16s${COLOR_RESET} %s\n", helpCommand, helpMessage; \ - } \ - } \ - { lastLine = $$0 }' $(MAKEFILE_LIST) +install: vendor -## Install -install: - composer install +test-unit: vendor + $(PHP) vendor/bin/phpunit -## Run tests -test: - vendor/bin/phpunit +test-coverage: vendor + $(PHP) vendor/bin/phpunit --coverage-text -## Loop unit tests -test-loop: - while true; \ - do vendor/bin/phpunit; \ - read continue; \ - done; +vendor: composer.lock + $(COMPOSER) install -## Code coverage -coverage: - vendor/bin/phpunit --coverage-text +composer.lock: composer.json + $(COMPOSER) update diff --git a/README.md b/README.md index 5239c28..c37a8a9 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,15 @@ This bundle integrates [algolia-specification](git@github.com:gbprod/algolia-specification.git) with Symfony. -![stability-wip](https://img.shields.io/badge/stability-work_in_progress-lightgrey.svg) - [![Build Status](https://travis-ci.org/gbprod/algolia-specification-bundle.svg?branch=master)](https://travis-ci.org/gbprod/algolia-specification-bundle) [![codecov](https://codecov.io/gh/gbprod/algolia-specification-bundle/branch/master/graph/badge.svg)](https://codecov.io/gh/gbprod/algolia-specification-bundle) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/gbprod/algolia-specification-bundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/gbprod/algolia-specification-bundle/?branch=master) [![Dependency Status](https://www.versioneye.com/user/projects/574a9c9ace8d0e004130d337/badge.svg)](https://www.versioneye.com/user/projects/574a9c9ace8d0e004130d337) -[![Latest Stable Version](https://poser.pugx.org/gbprod/algolia-specification-bundle/v/stable)](https://packagist.org/packages/gbprod/algolia-specification) -[![Total Downloads](https://poser.pugx.org/gbprod/algolia-specification-bundle/downloads)](https://packagist.org/packages/gbprod/algolia-specification) -[![Latest Unstable Version](https://poser.pugx.org/gbprod/algolia-specification-bundle/v/unstable)](https://packagist.org/packages/gbprod/algolia-specification) -[![License](https://poser.pugx.org/gbprod/algolia-specification-bundle/license)](https://packagist.org/packages/gbprod/algolia-specification) +[![Latest Stable Version](https://poser.pugx.org/gbprod/algolia-specification-bundle/v/stable)](https://packagist.org/packages/gbprod/algolia-specification-bundle) +[![Total Downloads](https://poser.pugx.org/gbprod/algolia-specification-bundle/downloads)](https://packagist.org/packages/gbprod/algolia-specification-bundle) +[![Latest Unstable Version](https://poser.pugx.org/gbprod/algolia-specification-bundle/v/unstable)](https://packagist.org/packages/gbprod/algolia-specification-bundle) +[![License](https://poser.pugx.org/gbprod/algolia-specification-bundle/license)](https://packagist.org/packages/gbprod/algolia-specification-bundle) ## Installation @@ -91,7 +89,7 @@ class IsAvailableFactory implements Factory ### Declare your Factory ```yaml -// src/GBProd/Acme/AcmeBundle/Resource/config/service.yml +# src/GBProd/Acme/AcmeBundle/Resource/config/service.yml services: acme.algolia.query_factory.is_available: @@ -103,7 +101,7 @@ services: ### Inject handler in your repository class ```yaml -// src/GBProd/Acme/AcmeBundle/Resource/config/service.yml +# src/GBProd/Acme/AcmeBundle/Resource/config/service.yml services: acme.product_repository: diff --git a/composer.json b/composer.json index 7b8ead0..9e41595 100644 --- a/composer.json +++ b/composer.json @@ -4,9 +4,9 @@ "type": "bundle", "require": { "php": ">=5.6", - "gbprod/algolia-specification": "^0.1", - "symfony/framework-bundle": "^2.3|^3.0", - "symfony/expression-language": "^2.3|^3.0" + "gbprod/algolia-specification": "^1.0", + "symfony/framework-bundle": "^2.7|^3.0", + "symfony/expression-language": "^2.7|^3.0" }, "require-dev": { "phpunit/phpunit": "^5.5" diff --git a/tests/AlgoliaSpecificationBundle/DependencyInjection/ConfigurationTest.php b/tests/AlgoliaSpecificationBundle/DependencyInjection/ConfigurationTest.php index 413d7ed..e884ebd 100644 --- a/tests/AlgoliaSpecificationBundle/DependencyInjection/ConfigurationTest.php +++ b/tests/AlgoliaSpecificationBundle/DependencyInjection/ConfigurationTest.php @@ -18,10 +18,7 @@ public function testGetConfigTreeBuilder() $tree = $configuration->getConfigTreeBuilder(); - $this->assertInstanceOf( - TreeBuilder::class, - $tree - ); + $this->assertInstanceOf(TreeBuilder::class, $tree); $this->assertEquals( 'algolia_specification_bundle',