Skip to content

Commit

Permalink
Merge pull request #3303 from morozov/doctrine-coding-standard-5
Browse files Browse the repository at this point in the history
Updated doctrine/coding-standard to 5.0,
  • Loading branch information
morozov authored Sep 28, 2018
2 parents 9355a2b + 9d513ca commit 3790851
Show file tree
Hide file tree
Showing 194 changed files with 8,560 additions and 8,317 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ jobs:
git fetch origin $TRAVIS_BRANCH;
fi
- git merge-base origin/$TRAVIS_BRANCH $TRAVIS_PULL_REQUEST_SHA || git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge --unshallow
- wget https://github.com/diff-sniffer/git/releases/download/0.1.0/git-phpcs.phar
- wget https://github.com/diff-sniffer/git/releases/download/0.2.0/git-phpcs.phar
- php git-phpcs.phar origin/$TRAVIS_BRANCH...$TRAVIS_PULL_REQUEST_SHA

- stage: Coding standard
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"doctrine/event-manager": "^1.0"
},
"require-dev": {
"doctrine/coding-standard": "^4.0",
"doctrine/coding-standard": "^5.0",
"jetbrains/phpstorm-stubs": "^2018.1.2",
"phpstan/phpstan": "^0.10.1",
"phpunit/phpunit": "^7.1.2",
Expand Down
54 changes: 28 additions & 26 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@
<rule ref="SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedProperty">
<exclude-pattern>tests/Doctrine/Tests/DBAL/Tools/TestAsset/*</exclude-pattern>
</rule>

<!-- see https://github.com/squizlabs/PHP_CodeSniffer/issues/2165 -->
<rule ref="Squiz.Arrays.ArrayDeclaration.SpaceBeforeComma">
<exclude-pattern>tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php</exclude-pattern>
</rule>
</ruleset>
46 changes: 18 additions & 28 deletions tests/Doctrine/Tests/DBAL/Cache/QueryCacheProfileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,26 @@ class QueryCacheProfileTest extends DbalTestCase
private const LIFETIME = 3600;
private const CACHE_KEY = 'user_specified_cache_key';

/**
* @var QueryCacheProfile
*/
/** @var QueryCacheProfile */
private $queryCacheProfile;

/**
* @var string
*/
/** @var string */
private $query = 'SELECT * FROM foo WHERE bar = ?';

/**
* @var int[]
*/
/** @var int[] */
private $params = [666];

/**
* @var string[]
*/
/** @var string[] */
private $types = [ParameterType::INTEGER];

/**
* @var string[]
*/
/** @var string[] */
private $connectionParams = [
'dbname' => 'database_name',
'user' => 'database_user',
'password' => 'database_password',
'host' => 'database_host',
'driver' => 'database_driver',
];
'dbname' => 'database_name',
'user' => 'database_user',
'password' => 'database_password',
'host' => 'database_host',
'driver' => 'database_driver',
];

protected function setUp()
{
Expand All @@ -50,7 +40,7 @@ protected function setUp()

public function testShouldUseTheGivenCacheKeyIfPresent()
{
list($cacheKey) = $this->queryCacheProfile->generateCacheKeys(
[$cacheKey] = $this->queryCacheProfile->generateCacheKeys(
$this->query,
$this->params,
$this->types,
Expand All @@ -64,7 +54,7 @@ public function testShouldGenerateAnAutomaticKeyIfNoKeyHasBeenGiven()
{
$this->queryCacheProfile = $this->queryCacheProfile->setCacheKey(null);

list($cacheKey) = $this->queryCacheProfile->generateCacheKeys(
[$cacheKey] = $this->queryCacheProfile->generateCacheKeys(
$this->query,
$this->params,
$this->types,
Expand All @@ -84,7 +74,7 @@ public function testShouldGenerateDifferentKeysForSameQueryAndParamsAndDifferent
{
$this->queryCacheProfile = $this->queryCacheProfile->setCacheKey(null);

list($firstCacheKey) = $this->queryCacheProfile->generateCacheKeys(
[$firstCacheKey] = $this->queryCacheProfile->generateCacheKeys(
$this->query,
$this->params,
$this->types,
Expand All @@ -93,7 +83,7 @@ public function testShouldGenerateDifferentKeysForSameQueryAndParamsAndDifferent

$this->connectionParams['host'] = 'a_different_host';

list($secondCacheKey) = $this->queryCacheProfile->generateCacheKeys(
[$secondCacheKey] = $this->queryCacheProfile->generateCacheKeys(
$this->query,
$this->params,
$this->types,
Expand All @@ -107,7 +97,7 @@ public function testConnectionParamsShouldBeHashed()
{
$this->queryCacheProfile = $this->queryCacheProfile->setCacheKey(null);

list($cacheKey, $queryString) = $this->queryCacheProfile->generateCacheKeys(
[$cacheKey, $queryString] = $this->queryCacheProfile->generateCacheKeys(
$this->query,
$this->params,
$this->types,
Expand All @@ -128,14 +118,14 @@ public function testShouldGenerateSameKeysIfNoneOfTheParamsChanges()
{
$this->queryCacheProfile = $this->queryCacheProfile->setCacheKey(null);

list($firstCacheKey) = $this->queryCacheProfile->generateCacheKeys(
[$firstCacheKey] = $this->queryCacheProfile->generateCacheKeys(
$this->query,
$this->params,
$this->types,
$this->connectionParams
);

list($secondCacheKey) = $this->queryCacheProfile->generateCacheKeys(
[$secondCacheKey] = $this->queryCacheProfile->generateCacheKeys(
$this->query,
$this->params,
$this->types,
Expand Down
21 changes: 1 addition & 20 deletions tests/Doctrine/Tests/DBAL/ConfigurationTest.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
<?php
/*
* 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.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Tests\DBAL;

Expand All @@ -24,15 +7,13 @@

/**
* Unit tests for the configuration container.
*
* @author Steve Müller <st.mueller@dzh-online.de>
*/
class ConfigurationTest extends DbalTestCase
{
/**
* The configuration container instance under test.
*
* @var \Doctrine\DBAL\Configuration
* @var Configuration
*/
protected $config;

Expand Down
Loading

0 comments on commit 3790851

Please sign in to comment.