Skip to content

Commit

Permalink
Fix CS v3.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Mar 12, 2022
1 parent 8c9be7b commit bd6b5aa
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/Model/Join.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public function beforeInsert(Model $entity, array &$data): void
$foreignModel = $this->getForeignModel();
$foreignEntity = $foreignModel->createEntity()
->setMulti($this->getAndUnsetSaveBuffer($entity))
/*->set($this->foreign_field, null)*/;
/* ->set($this->foreign_field, null) */;
$foreignEntity->save();

$this->setId($entity, $foreignEntity->getId());
Expand Down
8 changes: 4 additions & 4 deletions src/Model/ReferencesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function addRef(string $link, array $defaults): Reference
*
* @return Reference\HasOne|Reference\HasOneSql
*/
public function hasOne(string $link, array $defaults = []) //: Reference
public function hasOne(string $link, array $defaults = []) // : Reference
{
return $this->_addRef($this->_default_seed_hasOne, $link, $defaults); // @phpstan-ignore-line
}
Expand All @@ -73,7 +73,7 @@ public function hasOne(string $link, array $defaults = []) //: Reference
*
* @return Reference\HasMany
*/
public function hasMany(string $link, array $defaults = []) //: Reference
public function hasMany(string $link, array $defaults = []) // : Reference
{
return $this->_addRef($this->_default_seed_hasMany, $link, $defaults); // @phpstan-ignore-line
}
Expand All @@ -83,7 +83,7 @@ public function hasMany(string $link, array $defaults = []) //: Reference
*
* @return Reference\ContainsOne
*/
public function containsOne(string $link, array $defaults = []) //: Reference
public function containsOne(string $link, array $defaults = []) // : Reference
{
return $this->_addRef($this->_default_seed_containsOne, $link, $defaults); // @phpstan-ignore-line
}
Expand All @@ -93,7 +93,7 @@ public function containsOne(string $link, array $defaults = []) //: Reference
*
* @return Reference\ContainsMany
*/
public function containsMany(string $link, array $defaults = []) //: Reference
public function containsMany(string $link, array $defaults = []) // : Reference
{
return $this->_addRef($this->_default_seed_containsMany, $link, $defaults); // @phpstan-ignore-line
}
Expand Down
2 changes: 1 addition & 1 deletion src/Model/UserActionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ protected function initUserActions(): void
]);

$this->addUserAction('validate', [
//'appliesTo' => any!
// 'appliesTo' => any!
'description' => 'Provided with modified values will validate them but will not save',
'modifier' => UserAction::MODIFIER_READ,
'fields' => true,
Expand Down
16 changes: 8 additions & 8 deletions src/Persistence/Sql/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ protected function _render_from(): ?string
return empty($this->args['table']) ? '' : 'from';
}

/// }}}
// }}}

// {{{ with()

Expand Down Expand Up @@ -328,7 +328,7 @@ protected function _render_with(): ?string
return 'with ' . ($isRecursive ? 'recursive ' : '') . implode(',' . "\n", $ret) . "\n";
}

/// }}}
// }}}

// {{{ join()

Expand Down Expand Up @@ -820,7 +820,7 @@ protected function _render_set_fields(): ?string
$ret = [];

if ($this->args['set']) {
foreach ($this->args['set'] as [$field/*, $value*/ ]) {
foreach ($this->args['set'] as [$field/* , $value */ ]) {
$field = $this->consume($field, self::ESCAPE_IDENTIFIER);

$ret[] = $field;
Expand All @@ -836,7 +836,7 @@ protected function _render_set_values(): ?string
$ret = [];

if ($this->args['set']) {
foreach ($this->args['set'] as [/*$field*/ , $value]) {
foreach ($this->args['set'] as [/* $field */, $value]) {
$value = $this->consume($value, self::ESCAPE_PARAM);

$ret[] = $value;
Expand Down Expand Up @@ -1004,11 +1004,11 @@ public function exists()
public function __debugInfo(): array
{
$arr = [
//'mode' => $this->mode,
// 'mode' => $this->mode,
'R' => 'n/a',
'R_params' => 'n/a',
//'template' => $this->template,
//'templateArgs' => $this->args,
// 'template' => $this->template,
// 'templateArgs' => $this->args,
];

try {
Expand Down Expand Up @@ -1269,5 +1269,5 @@ protected function _set_args($what, $alias, $value): void
}
}

/// }}}
// }}}
}
2 changes: 0 additions & 2 deletions tests/ContainsOneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ public function testContainsOne(): void
$i->addr->delete();
$this->assertNull($i->get($i->fieldName()->addr));
$this->assertFalse($i->addr->isLoaded());

//var_dump($i->export(), $i->export(null, null, false));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/JoinSqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ public function testJoinReverseOneOnOne(): void
$m_user = new Model($this->db, ['table' => 'user']);
$m_user->addField('name');
$j = $m_user->join('detail.my_user_id', [
//'reverse' => true, // this will be reverse join by default
// 'reverse' => true, // this will be reverse join by default
// also no need to set these (will be done automatically), but still let's do that for test sake
'master_field' => 'id',
'foreign_field' => 'my_user_id',
Expand Down
2 changes: 1 addition & 1 deletion tests/LookupSqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public function testImportByLookup(): void
$u->import([
['name' => 'Alain', 'country_code' => 'CA'],
['name' => 'Imants', 'country_code' => 'LV'],
//'name' => 'Romans', 'country_code' => 'UK'], // does not exist
// 'name' => 'Romans', 'country_code' => 'UK'], // does not exist
]);

$this->assertSameExportUnordered([
Expand Down
4 changes: 2 additions & 2 deletions tests/Persistence/Sql/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function testFieldException1(): void
*/
public function testTableException3(): void
{
//$this->expectException(Exception::class); // no more
// $this->expectException(Exception::class); // no more
$this->q()->table($this->q()->expr('test'));
}

Expand Down Expand Up @@ -1548,7 +1548,7 @@ public function testCaseExprShortForm(): void
*/
public function testCaseExprException1(): void
{
//$this->expectException(Exception::class);
// $this->expectException(Exception::class);
$this->q()->caseExpr()
->caseWhen(['status'], 't2.expose_new')
->render();
Expand Down
2 changes: 1 addition & 1 deletion tests/Persistence/StaticTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function testBasicStatic(): void
$this->assertSame('world', $m->get('name'));

// custom title field and try loading from same static twice
$m = new Model($p); //, ['title_field' => 'foo']);
$m = new Model($p); // , ['title_field' => 'foo']);
$m = $m->load(2);
$this->assertSame('world', $m->get('name')); // still 'name' here not 'foo'
}
Expand Down
2 changes: 1 addition & 1 deletion tests/SmboTransferTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function setUp(): void
->field('document_id', ['type' => 'integer'])
->field('account_id', ['type' => 'integer'])
->field('cheque_no')
//->field('misc_payment', ['type' => 'enum(\'N\',\'Y\')'])
// ->field('misc_payment', ['type' => 'enum(\'N\',\'Y\')'])
->field('misc_payment')
->field('transfer_document_id')
->create();
Expand Down
2 changes: 1 addition & 1 deletion tests/SubTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ protected function init(): void
parent::init();
$this->hasOne('link_id', ['model' => [StTransaction_TransferIn::class]]);

//$this->join('transaction', 'linked_transaction');
// $this->join('transaction', 'linked_transaction');
}
}

Expand Down

0 comments on commit bd6b5aa

Please sign in to comment.