Skip to content

Commit

Permalink
CI build fixed, some deprecations fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ilario-pierbattista committed Dec 27, 2019
1 parent 765c9f9 commit e753d95
Show file tree
Hide file tree
Showing 26 changed files with 71 additions and 196 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/bin/
/.php_cs.cache
docker-compose.override.yml
.phpunit.result.cache
19 changes: 1 addition & 18 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@

filter:
excluded_paths:
- 'vendor/*'
- 'docker/*'
- 'tests/*'
- 'docs/*'
- 'bin/*'

checks:
php: true

coding_style:
php:
spaces:
before_keywords:
catch: false

tools:
external_code_coverage: true
- '*'
26 changes: 13 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ git:

env:
matrix:
- PHP_IMG="base-7.1-mongoext-1.1.5" MONGO_IMG="mongo:3.0" SYMFONY="3.4.*"
- PHP_IMG="base-7.2-mongoext-1.3.0" MONGO_IMG="mongo:3.4" SYMFONY="3.4.*"
- PHP_IMG="base-7.2-mongoext-1.3.0" MONGO_IMG="mongo:3.4" SYMFONY="4.*"
- PHP_IMG="base-7.2-mongoext-1.3.0" MONGO_IMG="mongo:3.4" SYMFONY="4.3.*"
- PHP_IMG="base-7.2-mongoext-1.3.0" MONGO_IMG="mongo:3.4" SYMFONY="4.4.*"
- PHP_IMG="base-7.2-mongoext-1.5.3" MONGO_IMG="percona/percona-server-mongodb:4.0"
- PHP_IMG="base-7.3-mongoext-1.5.3" MONGO_IMG="mongo:4.0"
- PHP_IMG="base-7.3-mongoext-1.5.3" MONGO_IMG="percona/percona-server-mongodb:4.0"
Expand All @@ -27,15 +27,15 @@ before_install:
install:
- |
if [ "$SYMFONY" != "" ]; then
docker-compose run --no-deps --rm php-cli composer require "symfony/symfony:${SYMFONY}" --no-update;
docker-compose run --no-deps --rm php composer require "symfony/symfony:${SYMFONY}" --no-update;
fi;
- docker-compose run --no-deps --rm php-cli composer install --prefer-dist --no-interaction ${COMPOSER_FLAGS}
- docker-compose run --no-deps --rm php composer install --prefer-dist --no-interaction ${COMPOSER_FLAGS}

before_script:
- docker-compose run --no-deps --rm php-cli composer validate
- docker-compose run --no-deps --rm php composer validate

script:
- docker-compose run --rm php-cli bash -c "sleep 3; bin/phpunit -c phpunit.xml.dist"
- docker-compose run --rm php bash -c "sleep 3; bin/phpunit -c phpunit.xml.dist"

jobs:
allow_failures:
Expand All @@ -48,14 +48,14 @@ jobs:
- stage: "Test"
env: PHP_IMG="base-7.2-mongoext-1.3.0" MONGO_IMG="mongo:3.4" SYMFONY="dev-master"
install:
- docker-compose run --no-deps --rm php-cli composer config minimum-stability dev
- docker-compose run --no-deps --rm php-cli composer install --prefer-dist --no-interaction ${COMPOSER_FLAGS}
- docker-compose run --no-deps --rm php composer config minimum-stability dev
- docker-compose run --no-deps --rm php composer install --prefer-dist --no-interaction ${COMPOSER_FLAGS}

- stage: "Analysis"
name: "coverage"
env: PHP_IMG="base-7.1-mongoext-1.1.5" MONGO_IMG="mongo:3.0" SYMFONY="3.4.*"
env: PHP_IMG="base-7.2-mongoext-1.3.0" MONGO_IMG="mongo:3.0" SYMFONY="3.4.*"
script:
- docker-compose run --rm php-cli bash -c "sleep 3; bin/phpunit -c phpunit.xml.dist --coverage-clover=./build/coverage/coverage.clover"
- docker-compose run --rm php bash -c "sleep 3; bin/phpunit -c phpunit.xml.dist --coverage-clover=./build/coverage/coverage.clover"
after_success:
- wget https://scrutinizer-ci.com/ocular.phar --output-document="${HOME}/bin/ocular"
- chmod +x "${HOME}/bin/ocular"
Expand All @@ -64,13 +64,13 @@ jobs:
- stage: "Analysis"
name: "phpstan"
script:
- docker-compose run --no-deps --rm php-cli bin/phpstan analyze -l7 src/ tests/
- docker-compose run --no-deps --rm php bin/phpstan analyze -l7 src/ tests/

- stage: "Analysis"
name: "cs-check"
script:
- docker-compose run --no-deps --rm php-cli composer cs-check src/
- docker-compose run --no-deps --rm php-cli composer cs-check tests/
- docker-compose run --no-deps --rm php composer cs-check src/
- docker-compose run --no-deps --rm php composer cs-check tests/

notifications:
on_success: change
Expand Down
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ up: docker-compose.yml
docker-compose up -d --force-recreate

setup: docker-compose.yml composer.json
docker-compose run --rm php-cli composer install
docker-compose run --rm php composer install

start: up
docker exec -ti mb_php bash
Expand All @@ -18,7 +18,15 @@ stop: docker-compose.yml
docker-compose stop

test: docker-compose.yml phpunit.xml.dist
docker-compose run --rm php-cli bash -c "bin/phpunit -c phpunit.xml.dist"
docker-compose run --rm php bash -c "bin/phpunit -c phpunit.xml.dist"

phpstan: docker-compose.yml
docker-compose run --rm php-cli bash -c "bin/phpstan analyze -l7 src/ tests/"
docker-compose run --rm php bash -c "bin/phpstan analyze -l7 src/ tests/"

setup-symfony-%: SYMFONY_VERSION = $*
setup-symfony-%:
rm composer.lock || true
docker-compose run --no-deps --rm php composer require-dev "symfony/symfony:${SYMFONY_VERSION}" --no-update;
docker-compose run --no-deps --rm php composer install --prefer-dist --no-interaction ${COMPOSER_FLAGS}

test-composer-install: setup-symfony-3.4 setup-symfony-4.3 setup-symfony-4.4
15 changes: 5 additions & 10 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

Bundle service integration of official [mongodb/mongo-php-library](https://github.com/mongodb/mongo-php-library) driver library, ([mongodb/mongodb](https://packagist.org/packages/mongodb/mongodb) on packagist)

[![PHP](https://img.shields.io/badge/php-%5E7.0-blue.svg)](https://img.shields.io/badge/php-%5E7.0-blue.svg)
[![PHP](https://img.shields.io/badge/php-%5E7.1-blue.svg)](https://img.shields.io/badge/php-%5E7.0-blue.svg)
[![MongoDB](https://img.shields.io/badge/MongoDB-%5E3.0-lightgrey.svg)](https://img.shields.io/badge/MongoDB-%5E3.0-lightgrey.svg)
[![ext-mongodb](https://img.shields.io/badge/ext_mongodb-%5E1.1.5-orange.svg)](https://img.shields.io/badge/ext_mongodb-%5E1.1.5-orange.svg)

[![Latest Stable Version](https://poser.pugx.org/facile-it/mongodb-bundle/v/stable)](https://packagist.org/packages/facile-it/mongodb-bundle)
[![Latest Unstable Version](https://poser.pugx.org/facile-it/mongodb-bundle/v/unstable)](https://packagist.org/packages/facile-it/mongodb-bundle) [![Total Downloads](https://poser.pugx.org/facile-it/mongodb-bundle/downloads)](https://packagist.org/packages/facile-it/mongodb-bundle)
[![License](https://poser.pugx.org/facile-it/mongodb-bundle/license)](https://packagist.org/packages/facile-it/mongodb-bundle)

[![Flex Support](https://img.shields.io/badge/Flex-supported-brightgreen.svg)]()
[![Build Status](https://travis-ci.org/facile-it/mongodb-bundle.svg?branch=master)](https://travis-ci.org/facile-it/mongodb-bundle)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/facile-it/mongodb-bundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/facile-it/mongodb-bundle/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/facile-it/mongodb-bundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/facile-it/mongodb-bundle/?branch=master)

### Installation

Expand All @@ -29,14 +28,10 @@ Then, enable the bundle on the `AppKernel` class:

public function registerBundles()
{
$bundles = array(
return [
// ...
new Facile\MongoDbBundle\FacileMongoDbBundle(),
);

// ...

return $bundles
];
}
```

Expand Down Expand Up @@ -160,7 +155,7 @@ To setup the project:
make setup
```

To start the container and log into the php-cli:
To start the container and log into the php:
```bash
make start
```
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@
}
],
"require": {
"php": "^7.1",
"php": "^7.2",
"ext-mongodb": "^1.1.5",
"mongodb/mongodb": "^1.0",
"symfony/framework-bundle": "^3.0 || ^4.0"
"symfony/framework-bundle": "^3.4 || ^4.3"
},
"require-dev": {
"matthiasnoback/symfony-dependency-injection-test": "^2.3",
"symfony/web-profiler-bundle": "^2.8 || ^3.0 || ^4.0",
"symfony/console": "^2.8 || ^3.0 || ^4.0",
"phpunit/phpunit": "^6.0",
"matthiasnoback/symfony-dependency-injection-test": "^3",
"symfony/web-profiler-bundle": "^3.4 || ^4.3",
"symfony/console": "^3.4 || ^4.3",
"phpunit/phpunit": "^7.0",
"symfony/phpunit-bridge": "^4.2",
"facile-it/facile-coding-standard": "^0.3.1",
"phpstan/phpstan": "^0.11.7"
"phpstan/phpstan": "^0.12"
},
"minimum-stability": "stable",
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.1"

services:
php-cli:
php:
image: ilariopierbattista/mongodb-bundle-php:${PHP_IMG}
volumes:
- ./:/home/user-dev/project
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: "3.1"

services:
php-cli:
image: ilariopierbattista/mongodb-bundle-php:base-7.1-mongoext-1.3.0
php:
image: ilariopierbattista/mongodb-bundle-php:base-7.2-mongoext-1.3.0
volumes:
- ./:/home/user-dev/project
tty: true
Expand Down
42 changes: 0 additions & 42 deletions docker/Makefile

This file was deleted.

66 changes: 0 additions & 66 deletions docker/php-cli/base/Dockerfile

This file was deleted.

2 changes: 2 additions & 0 deletions src/Command/DropCollectionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->io->writeln(sprintf('Dropping collection %s', $collection));
$this->connection->dropCollection($collection);
$this->io->writeln('Collection dropped');

return 0;
}
}
2 changes: 2 additions & 0 deletions src/Command/DropDatabaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->io->writeln(sprintf('Dropping database %s', $this->connection->getDatabaseName()));
$this->connection->drop();
$this->io->writeln('Database dropped');

return 0;
}
}
2 changes: 2 additions & 0 deletions src/Command/LoadFixturesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$this->io->writeln(sprintf('Done, loaded %d fixtures files', \count($fixtures)));

return 0;
}

/**
Expand Down
3 changes: 0 additions & 3 deletions src/DataCollector/MongoDbDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ public function setLogger(DataCollectorLoggerInterface $logger)
$this->logger = $logger;
}

/**
* {@inheritdoc}
*/
public function collect(Request $request, Response $response, \Exception $exception = null)
{
while ($this->logger->hasLoggedEvents()) {
Expand Down
3 changes: 2 additions & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ private function addDriverOptions(NodeBuilder $builder)
->info('Service id name');
}

private function addDriversOptionFactory(NodeBuilder $builder) {
private function addDriversOptionFactory(NodeBuilder $builder)
{
$connectionBuilder = $builder
->scalarNode('driverOptions');
}
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/MongoDbBundleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ private function attachDataCollectionListenerToEventManager(): void

private function defineDriverOptionsFactory(array $config)
{
return (isset($config['driverOptions']) ? new Reference($config['driverOptions']) : null);
return isset($config['driverOptions']) ? new Reference($config['driverOptions']) : null;
}
}
Loading

0 comments on commit e753d95

Please sign in to comment.