Skip to content

Commit

Permalink
Update facile-it/facile-coding-standard requirement from ^0.4.0 to ^1…
Browse files Browse the repository at this point in the history
….0.1 (#138)

* Update facile-it/facile-coding-standard requirement

Updates the requirements on [facile-it/facile-coding-standard](https://github.com/facile-it/facile-coding-standard) to permit the latest version.
- [Release notes](https://github.com/facile-it/facile-coding-standard/releases)
- [Changelog](https://github.com/facile-it/facile-coding-standard/blob/1.x/CHANGELOG.md)
- [Commits](facile-it/facile-coding-standard@0.4.0...1.0.1)

---
updated-dependencies:
- dependency-name: facile-it/facile-coding-standard
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

* Refactor config to work with PHP-CS-Fixer 3

* Apply CS fixes due to new CS rules

* Fix PHPStan error

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alessandro Lai <[email protected]>
  • Loading branch information
dependabot[bot] and Jean85 authored Dec 22, 2023
1 parent 427aa14 commit 0161ad7
Show file tree
Hide file tree
Showing 44 changed files with 74 additions and 418 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
/vendor/
/bin/
.php_cs.cache
/.php-cs-fixer.php
/.php-cs-fixer.cache
docker-compose.override.yml
.phpunit.result.cache
auth.json
Expand Down
14 changes: 10 additions & 4 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@
* Additional rules or rules to override.
* These rules will be added to default rules or will override them if the same key already exists.
*/

$additionalRules = [];

$additionalRules = [
'blank_line_after_opening_tag' => false,
];

$rulesProvider = new Facile\CodingStandards\Rules\CompositeRulesProvider([
new Facile\CodingStandards\Rules\DefaultRulesProvider(),
new Facile\CodingStandards\Rules\ArrayRulesProvider($additionalRules),
]);

$config = PhpCsFixer\Config::create();
$config->setRules($rulesProvider->getRules());
$config = new PhpCsFixer\Config();
$config
->setUsingCache(true)
->setRiskyAllowed(true)
->setRules($rulesProvider->getRules());

$finder = PhpCsFixer\Finder::create();

Expand Down
24 changes: 0 additions & 24 deletions .php-cs.php

This file was deleted.

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"symfony/console": "^3.4 || ^4.3 || ^5.0 || ^6.0",
"phpunit/phpunit": "^9.6.13",
"symfony/phpunit-bridge": "^7.0",
"facile-it/facile-coding-standard": "^0.4.0",
"facile-it/facile-coding-standard": "^1.0.1",
"phpstan/phpstan": "1.10.50",
"phpstan/extension-installer": "1.3.1",
"jangregor/phpstan-prophecy": "1.0.0",
Expand Down Expand Up @@ -66,8 +66,8 @@
}
},
"scripts": {
"cs-check": "php-cs-fixer fix --dry-run --diff --config=.php-cs.php",
"cs-fix": "php-cs-fixer fix --diff --config=.php-cs.php",
"cs-check": "php-cs-fixer fix --dry-run --diff",
"cs-fix": "php-cs-fixer fix --diff",
"test": "bin/phpunit tests"
}
}
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ parameters:
count: 1
path: src/Capsule/Collection.php

-
message: "#^PHPDoc tag @var has invalid value \\(\\$profiler \\\\Symfony\\\\Component\\\\HttpKernel\\\\Profiler\\\\Profiler\\)\\: Unexpected token \"\\$profiler\", expected type at offset 9$#"
count: 1
path: src/Controller/ProfilerController.php

-
message: "#^Property Facile\\\\MongoDbBundle\\\\Controller\\\\ProfilerController\\:\\:\\$container \\(Symfony\\\\Component\\\\DependencyInjection\\\\Container\\) does not accept Symfony\\\\Component\\\\DependencyInjection\\\\ContainerInterface\\|null\\.$#"
count: 1
Expand Down
8 changes: 2 additions & 6 deletions src/Capsule/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ final class Client extends MongoClient
* Client constructor.
*
* @param string $uri
* @param array $uriOptions
* @param array $driverOptions
* @param string $clientName
* @param EventDispatcherInterface $eventDispatcher
*
* @internal param DataCollectorLoggerInterface $logger
*/
Expand All @@ -44,7 +40,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function selectDatabase($databaseName, array $options = [])
{
Expand All @@ -57,7 +53,7 @@ public function selectDatabase($databaseName, array $options = [])
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function selectCollection($databaseName, $collectionName, array $options = [])
{
Expand Down
50 changes: 12 additions & 38 deletions src/Capsule/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ final class Collection extends MongoCollection
/** @var string */
private $databaseName;

/**
* @param Manager $manager
* @param string $clientName
* @param string $databaseName
* @param string $collectionName
* @param array $options
* @param EventDispatcherInterface $eventDispatcher
*/
public function __construct(
Manager $manager,
string $clientName,
Expand All @@ -49,7 +41,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function aggregate(array $pipeline, array $options = [])
{
Expand All @@ -61,7 +53,7 @@ public function aggregate(array $pipeline, array $options = [])
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function count($filter = [], array $options = [])
{
Expand All @@ -73,7 +65,7 @@ public function count($filter = [], array $options = [])
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function find($filter = [], array $options = [])
{
Expand All @@ -85,7 +77,7 @@ public function find($filter = [], array $options = [])
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function findOne($filter = [], array $options = [])
{
Expand All @@ -97,7 +89,7 @@ public function findOne($filter = [], array $options = [])
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function findOneAndUpdate($filter, $update, array $options = [])
{
Expand All @@ -109,7 +101,7 @@ public function findOneAndUpdate($filter, $update, array $options = [])
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function findOneAndDelete($filter, array $options = [])
{
Expand All @@ -121,7 +113,7 @@ public function findOneAndDelete($filter, array $options = [])
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function deleteMany($filter, array $options = [])
{
Expand All @@ -133,7 +125,7 @@ public function deleteMany($filter, array $options = [])
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function deleteOne($filter, array $options = [])
{
Expand All @@ -145,7 +137,7 @@ public function deleteOne($filter, array $options = [])
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function replaceOne($filter, $replacement, array $options = [])
{
Expand All @@ -157,7 +149,7 @@ public function replaceOne($filter, $replacement, array $options = [])
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function insertOne($document, array $options = [])
{
Expand All @@ -169,7 +161,7 @@ public function insertOne($document, array $options = [])
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function updateOne($filter, $update, array $options = [])
{
Expand All @@ -181,7 +173,7 @@ public function updateOne($filter, $update, array $options = [])
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function distinct($fieldName, $filter = [], array $options = [])
{
Expand All @@ -193,12 +185,8 @@ public function distinct($fieldName, $filter = [], array $options = [])
}

/**
* @param string $method
* @param array|object $filters
* @param array|object $data
* @param array $options
*
* @return Query
*/
private function prepareQuery(string $method, $filters, $data, array $options): Query
{
Expand All @@ -224,11 +212,6 @@ private function prepareQuery(string $method, $filters, $data, array $options):
return $query;
}

/**
* @param ReadPreference $readPreference
*
* @return string
*/
private function translateReadPreference(ReadPreference $readPreference): string
{
switch ($readPreference->getMode()) {
Expand All @@ -247,9 +230,6 @@ private function translateReadPreference(ReadPreference $readPreference): string
}
}

/**
* @param Query $queryLog
*/
private function notifyQueryExecution(Query $queryLog)
{
$queryLog->setExecutionTime(microtime(true) - $queryLog->getStart());
Expand All @@ -262,17 +242,11 @@ private function notifyQueryExecution(Query $queryLog)
}
}

/**
* @return string
*/
public function getClientName(): string
{
return $this->clientName;
}

/**
* @return string
*/
public function getDatabaseName(): string
{
return $this->databaseName;
Expand Down
10 changes: 2 additions & 8 deletions src/Capsule/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ final class Database extends MongoDatabase
/**
* Database constructor.
*
* @param Manager $manager
* @param string $clientName
* @param string $databaseName
* @param array $options
* @param EventDispatcherInterface $eventDispatcher
*
* @internal param DataCollectorLoggerInterface $logger
*/
public function __construct(
Expand All @@ -49,7 +43,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function selectCollection($collectionName, array $options = [])
{
Expand All @@ -72,7 +66,7 @@ public function selectCollection($collectionName, array $options = [])
}

/**
* {@inheritdoc}
* @inheritDoc
*/
public function withOptions(array $options = [])
{
Expand Down
6 changes: 2 additions & 4 deletions src/Command/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ abstract class AbstractCommand extends Command

/**
* AbstractCommand constructor.
*
* @param ContainerInterface $container
*/
public function __construct(ContainerInterface $container, string $name = null)
{
Expand All @@ -43,7 +41,7 @@ protected function getContainer(): ContainerInterface
}

/**
* {@inheritdoc}
* @inheritDoc
*/
protected function configure()
{
Expand All @@ -53,7 +51,7 @@ protected function configure()
}

/**
* {@inheritdoc}
* @inheritDoc
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
Expand Down
7 changes: 2 additions & 5 deletions src/Command/DropCollectionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
* Class DropCollectionCommand.
*/
class DropCollectionCommand extends AbstractCommand
{
/**
* {@inheritdoc}
* @inheritDoc
*/
protected function configure()
{
Expand All @@ -26,7 +23,7 @@ protected function configure()
}

/**
* {@inheritdoc}
* @inheritDoc
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
Expand Down
Loading

0 comments on commit 0161ad7

Please sign in to comment.