Skip to content

Commit

Permalink
Enhancement: Enable binary_operator_spaces fixer (#219)
Browse files Browse the repository at this point in the history
* Enhancement: Enable binary_operator_spaces fixer

* Fix: Run 'make cs'
  • Loading branch information
localheinz committed Dec 22, 2020
1 parent 13e2d54 commit cfee524
Show file tree
Hide file tree
Showing 31 changed files with 1,099 additions and 1,098 deletions.
1 change: 1 addition & 0 deletions .php_cs.dist
Expand Up @@ -23,6 +23,7 @@ return $config
'array_syntax' => [
'syntax' => 'short',
],
'binary_operator_spaces' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => [
'statements' => [
Expand Down
920 changes: 460 additions & 460 deletions src/Faker/Core/File.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Faker/Documentor.php
Expand Up @@ -18,7 +18,7 @@ public function getFormatters()
{
$formatters = [];
$providers = array_reverse($this->generator->getProviders());
$providers[]= new Provider\Base($this->generator);
$providers[] = new Provider\Base($this->generator);

foreach ($providers as $provider) {
$providerClass = get_class($provider);
Expand All @@ -42,7 +42,7 @@ public function getFormatters()
if ($reflparameter->isDefaultValueAvailable()) {
$parameter .= ' = ' . var_export($reflparameter->getDefaultValue(), true);
}
$parameters[]= $parameter;
$parameters[] = $parameter;
}
$parameters = $parameters ? '(' . implode(', ', $parameters) . ')' : '';

Expand Down
4 changes: 2 additions & 2 deletions src/Faker/ORM/Doctrine/Populator.php
Expand Up @@ -105,8 +105,8 @@ public function execute($entityManager = null)
foreach ($this->quantities as $class => $number) {
$generateId = $this->generateId[$class];

for ($i=0; $i < $number; ++$i) {
$insertedEntities[$class][]= $this->entities[$class]->execute(
for ($i = 0; $i < $number; ++$i) {
$insertedEntities[$class][] = $this->entities[$class]->execute(
$entityManager,
$insertedEntities,
$generateId
Expand Down
2 changes: 1 addition & 1 deletion src/Faker/ORM/Mandango/EntityPopulator.php
Expand Up @@ -103,7 +103,7 @@ public function execute(Mandango $mandango, $insertedEntities)

foreach ($this->columnFormatters as $column => $format) {
if (null !== $format) {
$value = is_callable($format) ? $format($insertedEntities, $obj) : $format;
$value = is_callable($format) ? $format($insertedEntities, $obj) : $format;

if (isset($metadata['fields'][$column])
|| isset($metadata['referencesOne'][$column])) {
Expand Down
4 changes: 2 additions & 2 deletions src/Faker/ORM/Mandango/Populator.php
Expand Up @@ -52,8 +52,8 @@ public function execute()
$insertedEntities = [];

foreach ($this->quantities as $class => $number) {
for ($i=0; $i < $number; ++$i) {
$insertedEntities[$class][]= $this->entities[$class]->execute($this->mandango, $insertedEntities);
for ($i = 0; $i < $number; ++$i) {
$insertedEntities[$class][] = $this->entities[$class]->execute($this->mandango, $insertedEntities);
}
}
$this->mandango->flush();
Expand Down
4 changes: 2 additions & 2 deletions src/Faker/ORM/Propel/Populator.php
Expand Up @@ -61,8 +61,8 @@ public function execute($con = null)
$con->beginTransaction();

foreach ($this->quantities as $class => $number) {
for ($i=0; $i < $number; ++$i) {
$insertedEntities[$class][]= $this->entities[$class]->execute($con, $insertedEntities);
for ($i = 0; $i < $number; ++$i) {
$insertedEntities[$class][] = $this->entities[$class]->execute($con, $insertedEntities);
}
}
$con->commit();
Expand Down
4 changes: 2 additions & 2 deletions src/Faker/ORM/Propel2/Populator.php
Expand Up @@ -64,8 +64,8 @@ public function execute($con = null)
$con->beginTransaction();

foreach ($this->quantities as $class => $number) {
for ($i=0; $i < $number; ++$i) {
$insertedEntities[$class][]= $this->entities[$class]->execute($con, $insertedEntities);
for ($i = 0; $i < $number; ++$i) {
$insertedEntities[$class][] = $this->entities[$class]->execute($con, $insertedEntities);
}
}
$con->commit();
Expand Down
6 changes: 3 additions & 3 deletions src/Faker/Provider/Base.php
Expand Up @@ -315,9 +315,9 @@ public static function shuffleArray($array = [])
}

if ($j == $i) {
$shuffledArray[]= $value;
$shuffledArray[] = $value;
} else {
$shuffledArray[]= $shuffledArray[$j];
$shuffledArray[] = $shuffledArray[$j];
$shuffledArray[$j] = $value;
}
++$i;
Expand Down Expand Up @@ -352,7 +352,7 @@ public static function shuffleString($string = '', $encoding = 'UTF-8')
$strlen = mb_strlen($string, $encoding);

for ($i = 0; $i < $strlen; ++$i) {
$array[]= mb_substr($string, $i, 1, $encoding);
$array[] = mb_substr($string, $i, 1, $encoding);
}
} else {
$array = str_split($string, 1);
Expand Down
4 changes: 2 additions & 2 deletions src/Faker/Provider/DateTime.php
Expand Up @@ -179,8 +179,8 @@ public static function dateTimeBetween($startDate = '-30 years', $endDate = 'now
public static function dateTimeInInterval($date = '-30 years', $interval = '+5 days', $timezone = null)
{
$intervalObject = \DateInterval::createFromDateString($interval);
$datetime = $date instanceof \DateTime ? $date : new \DateTime($date);
$otherDatetime = clone $datetime;
$datetime = $date instanceof \DateTime ? $date : new \DateTime($date);
$otherDatetime = clone $datetime;
$otherDatetime->add($intervalObject);

$begin = $datetime > $otherDatetime ? $otherDatetime : $datetime;
Expand Down

0 comments on commit cfee524

Please sign in to comment.