Skip to content

Commit

Permalink
Merge pull request #1643 from spryker/cs-tests-src
Browse files Browse the repository at this point in the history
CS for tests
  • Loading branch information
dereuromark committed Aug 5, 2020
2 parents 42c6da4 + 008ff38 commit 3cc71ba
Show file tree
Hide file tree
Showing 313 changed files with 1,617 additions and 1,426 deletions.
4 changes: 0 additions & 4 deletions config/phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,4 @@
<severity>0</severity>
</rule>

<rule ref="Spryker.Commenting.DocBlockReturnSelf">
<severity>0</severity>
</rule>

</ruleset>
10 changes: 0 additions & 10 deletions phpstan-baseline.neon

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

1 change: 0 additions & 1 deletion resources/dtd/database.dtd
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!--
Propel XML database schema DTD
$Id: database.dtd,v 1.7 2005/03/30 11:38:18 hlellelid Exp $

This is based very closely on the schema DTD for Torque, but
some differences do exist.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ public function doCount(ConnectionInterface \$con = null)
\$this->cacheStore(\$key, \$sql);
}
return \$con->getDataFetcher(\$stmt);
}
";
Expand Down
15 changes: 6 additions & 9 deletions src/Propel/Generator/Builder/Util/SchemaReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,18 @@ class SchemaReader
private $defaultPackage;

/**
* @var bool
*/
private $firstPass;

/**
* @deprecated Unused.
*
* @var string
*/
private $encoding;

/**
* @var array
* two-dimensional array,
* Two-dimensional array,
* first dimension is for schemas(key is the path to the schema file),
* second is for tags within the schema
* second is for tags within the schema.
*
* @var array
*/
private $schemasTagsStack = [];

Expand All @@ -124,7 +122,6 @@ public function __construct(?PlatformInterface $defaultPlatform = null, $default
{
$this->schema = new Schema($defaultPlatform);
$this->defaultPackage = $defaultPackage;
$this->firstPass = true;
$this->encoding = $encoding;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Propel/Generator/Command/Console/Input/ArrayInput.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

/*
/**
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
Expand Down
2 changes: 2 additions & 0 deletions src/Propel/Generator/Util/BehaviorLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class BehaviorLocator
private $composerDir;

/**
* @deprecated Unused.
*
* @var \Propel\Generator\Config\GeneratorConfigInterface
*/
private $generatorConfig;
Expand Down
30 changes: 21 additions & 9 deletions src/Propel/Runtime/ActiveQuery/Criteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -771,11 +771,13 @@ public function get($key)
* @param string $key
* @param mixed $value
*
* @return $this Instance of self.
* @return $this
*/
public function put($key, $value)
{
return $this->add($key, $value);
$this->add($key, $value);

return $this;
}

/**
Expand Down Expand Up @@ -936,7 +938,9 @@ public function addJoin($left, $right, $joinType = null)
$conditions[] = $condition;
}

return $this->addMultipleJoin($conditions, $joinType);
$this->addMultipleJoin($conditions, $joinType);

return $this;
}

$join = new Join();
Expand Down Expand Up @@ -966,7 +970,9 @@ public function addJoin($left, $right, $joinType = null)

$join->setJoinType($joinType);

return $this->addJoinObject($join);
$this->addJoinObject($join);

return $this;
}

/**
Expand Down Expand Up @@ -1042,7 +1048,9 @@ public function addMultipleJoin($conditions, $joinType = null)
$join->setJoinType($joinType);
$join->setJoinCondition($joinCondition);

return $this->addJoinObject($join);
$this->addJoinObject($join);

return $this;
}

/**
Expand Down Expand Up @@ -1886,10 +1894,14 @@ public function addUsingOperator($p1, $value = null, $operator = null, $preferCo
if ($this->defaultCombineOperator === Criteria::LOGICAL_OR) {
$this->defaultCombineOperator = Criteria::LOGICAL_AND;

return $this->addOr($p1, $value, $operator, $preferColumnCondition);
$this->addOr($p1, $value, $operator, $preferColumnCondition);

return $this;
}

return $this->addAnd($p1, $value, $operator, $preferColumnCondition);
$this->addAnd($p1, $value, $operator, $preferColumnCondition);

return $this;
}

/**
Expand Down Expand Up @@ -2808,7 +2820,7 @@ public function _elseif($cond)
*
* @throws \Propel\Runtime\Exception\LogicException
*
* @return \Propel\Runtime\Util\PropelConditionalProxy|$this
* @return \Propel\Runtime\Util\PropelConditionalProxy|static
*/
public function _else()
{
Expand All @@ -2825,7 +2837,7 @@ public function _else()
*
* @throws \Propel\Runtime\Exception\LogicException
*
* @return $this
* @return $this|\Propel\Runtime\ActiveQuery\Criteria
*/
public function _endif()
{
Expand Down
10 changes: 7 additions & 3 deletions src/Propel/Runtime/ActiveQuery/ModelCriteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ public function condition($conditionName, $clause, $value = null, $bindingType =
*/
public function filterBy($column, $value, $comparison = Criteria::EQUAL)
{
return $this->add($this->getRealColumnName($column), $value, $comparison);
$this->add($this->getRealColumnName($column), $value, $comparison);

return $this;
}

/**
Expand Down Expand Up @@ -882,7 +884,7 @@ public function setPrimaryCriteria(ModelCriteria $criteria, Join $previousJoin)
/**
* Gets the primary criteria for this secondary Criteria
*
* @return $this|null The primary criteria
* @return \Propel\Runtime\ActiveQuery\ModelCriteria|null The primary criteria
*/
public function getPrimaryCriteria()
{
Expand Down Expand Up @@ -2240,7 +2242,9 @@ public static function getShortName($fullyQualifiedClassName)
*/
public function addUsingAlias($column, $value = null, $operator = null)
{
return $this->addUsingOperator($this->getAliasedColName($column), $value, $operator);
$this->addUsingOperator($this->getAliasedColName($column), $value, $operator);

return $this;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/Propel/Runtime/ActiveQuery/ModelJoin.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ public function isPrimary()
*/
public function setRelationAlias($relationAlias)
{
return $this->setRightTableAlias($relationAlias);
$this->setRightTableAlias($relationAlias);

return $this;
}

/**
Expand Down
6 changes: 6 additions & 0 deletions tests/Propel/Tests/Bookstore/AuthorCollection.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* MIT License. This file is part of the Propel package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Propel\Tests\Bookstore;

use Propel\Runtime\Collection\ObjectCollection;
Expand Down
4 changes: 1 addition & 3 deletions tests/Propel/Tests/BookstoreLoggingTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?php

/**
* This file is part of the Propel package.
* MIT License. This file is part of the Propel package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license MIT License
*/

namespace Propel\Tests;
Expand Down
4 changes: 1 addition & 3 deletions tests/Propel/Tests/BookstoreTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?php

/**
* This file is part of the Propel package.
* MIT License. This file is part of the Propel package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license MIT License
*/

namespace Propel\Tests;
Expand Down
11 changes: 1 addition & 10 deletions tests/Propel/Tests/CharacterEncodingTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?php

/**
* This file is part of the Propel package.
* MIT License. This file is part of the Propel package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license MIT License
*/

namespace Propel\Tests;
Expand Down Expand Up @@ -38,13 +36,6 @@
*/
class CharacterEncodingTest extends BookstoreTestBase
{
/**
* Database adapter.
*
* @var DBAdapter
*/
private $adapter;

/**
* @throws \Exception
*
Expand Down
10 changes: 5 additions & 5 deletions tests/Propel/Tests/Common/Config/ConfigTestCase.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?php

/**
* This file is part of the Propel package.
* MIT License. This file is part of the Propel package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license MIT License
*/

namespace Propel\Tests\Common\Config;
Expand All @@ -21,11 +19,13 @@
class ConfigTestCase extends TestCase
{
/**
* @var null
* Symfony\Component\Filesystem\Filesystem instance
* @var \Symfony\Component\Filesystem\Filesystem|null
*/
private $fileSystem;

/**
* @return \Symfony\Component\Filesystem\Filesystem
*/
public function getFilesystem()
{
if (null === $this->fileSystem) {
Expand Down
17 changes: 8 additions & 9 deletions tests/Propel/Tests/Common/Config/ConfigurationManagerTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?php

/**
* This file is part of the Propel package.
* MIT License. This file is part of the Propel package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license MIT License
*/

namespace Propel\Tests\Common\Config;
Expand Down Expand Up @@ -114,6 +112,7 @@ public function testNotExistingConfigFileLoadsDefaultSettingsAndDoesNotThrowExce
$this->getFilesystem()->dumpFile('doctrine.yaml', $yamlConf);

$manager = new TestableConfigurationManager();
$this->assertInstanceOf(ConfigurationManager::class, $manager);
}

/**
Expand Down Expand Up @@ -154,7 +153,7 @@ public function testUnsupportedExtensionsAreIgnored()
}

/**
* @expectedException Propel\Common\Config\Exception\InvalidArgumentException
* @expectedException \Propel\Common\Config\Exception\InvalidArgumentException
*
* @exceptionMessage Propel expects only one configuration file
*
Expand All @@ -177,7 +176,7 @@ public function testMoreThanOneConfigurationFileInSameDirectoryThrowsException()
}

/**
* @expectedException Propel\Common\Config\Exception\InvalidArgumentException
* @expectedException \Propel\Common\Config\Exception\InvalidArgumentException
*
* @exceptionMessage Propel expects only one configuration file
*
Expand Down Expand Up @@ -385,7 +384,7 @@ public function testMergeExtraProperties()
}

/**
* @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
* @expectedExceptionMessage Unrecognized options "foo, bar" under "propel"
*
* @return void
Expand Down Expand Up @@ -439,7 +438,7 @@ classname: Propel\Runtime\Connection\ConnectionWrapper
}

/**
* @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
* @expectedExceptionMessage The child node "database" at path "propel" must be configured
*
* @return void
Expand All @@ -458,7 +457,7 @@ public function testNotDefineDatabaseSectionTrowsException()
}

/**
* @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
* @expectedExceptionMessage Dots are not allowed in connection names
*
* @return void
Expand Down Expand Up @@ -648,7 +647,7 @@ classname: Propel\Runtime\Connection\DebugPDO
}

/**
* @expectedException Propel\Common\Config\Exception\InvalidArgumentException
* @expectedException \Propel\Common\Config\Exception\InvalidArgumentException
* @expectedExceptionMessage Invalid configuration property name
*
* @return void
Expand Down

0 comments on commit 3cc71ba

Please sign in to comment.