Skip to content

Commit

Permalink
Improve coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Jun 20, 2020
1 parent 94eff22 commit 5089a96
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 31 deletions.
9 changes: 4 additions & 5 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
$header = <<<EOF
League CSV Doctrine Collection Bridge (https://github.com/bakame-php/csv-doctrine-bridge)
@author Ignace Nyamagana Butera <[email protected]>
@license https://github.com/bakame-php/csv-doctrine-bridge/blob/master/LICENSE (MIT License)
@version 1.0.0
@link https://github.com/bakame-php/csv-doctrine-bridge
(c) Ignace Nyamagana Butera <[email protected]>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
Expand All @@ -33,8 +30,9 @@ return PhpCsFixer\Config::create()
'no_leading_import_slash' => true,
'no_superfluous_phpdoc_tags' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_superfluous_phpdoc_tags' => true,
'no_unused_imports' => true,
'ordered_imports' => ['importsOrder' => null, 'sortAlgorithm' => 'alpha'],
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'],
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
'phpdoc_align' => true,
'phpdoc_no_empty_return' => true,
Expand All @@ -52,6 +50,7 @@ return PhpCsFixer\Config::create()
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => true,
])
->setFinder($finder)
;
9 changes: 3 additions & 6 deletions src/CriteriaConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@
/**
* League CSV Doctrine Collection Bridge (https://github.com/bakame-php/csv-doctrine-bridge)
*
* @author Ignace Nyamagana Butera <[email protected]>
* @license https://github.com/bakame-php/csv-doctrine-bridge/blob/master/LICENSE (MIT License)
* @version 1.0.0
* @link https://github.com/bakame-php/csv-doctrine-bridge
* (c) Ignace Nyamagana Butera <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Bakame\Csv\Extension;

use function array_reverse;
use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\Expr\ClosureExpressionVisitor;
use League\Csv\Statement;
use function array_reverse;

final class CriteriaConverter
{
Expand Down Expand Up @@ -64,7 +61,7 @@ public static function addOrderBy(Criteria $criteria, Statement $stmt = null): S
foreach (array_reverse($criteria->getOrderings()) as $field => $ordering) {
$next = ClosureExpressionVisitor::sortByField(
$field,
$ordering === Criteria::DESC ? -1 : 1,
Criteria::DESC === $ordering ? -1 : 1,
$next
);
}
Expand Down
5 changes: 1 addition & 4 deletions src/CriteriaConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
/**
* League CSV Doctrine Collection Bridge (https://github.com/bakame-php/csv-doctrine-bridge)
*
* @author Ignace Nyamagana Butera <[email protected]>
* @license https://github.com/bakame-php/csv-doctrine-bridge/blob/master/LICENSE (MIT License)
* @version 1.0.0
* @link https://github.com/bakame-php/csv-doctrine-bridge
* (c) Ignace Nyamagana Butera <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
5 changes: 1 addition & 4 deletions src/RecordCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
/**
* League CSV Doctrine Collection Bridge (https://github.com/bakame-php/csv-doctrine-bridge)
*
* @author Ignace Nyamagana Butera <[email protected]>
* @license https://github.com/bakame-php/csv-doctrine-bridge/blob/master/LICENSE (MIT License)
* @version 1.0.0
* @link https://github.com/bakame-php/csv-doctrine-bridge
* (c) Ignace Nyamagana Butera <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
5 changes: 1 addition & 4 deletions src/RecordCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
/**
* League CSV Doctrine Collection Bridge (https://github.com/bakame-php/csv-doctrine-bridge)
*
* @author Ignace Nyamagana Butera <[email protected]>
* @license https://github.com/bakame-php/csv-doctrine-bridge/blob/master/LICENSE (MIT License)
* @version 1.0.0
* @link https://github.com/bakame-php/csv-doctrine-bridge
* (c) Ignace Nyamagana Butera <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
5 changes: 1 addition & 4 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
/**
* League CSV Doctrine Collection Bridge (https://github.com/bakame-php/csv-doctrine-bridge)
*
* @author Ignace Nyamagana Butera <[email protected]>
* @license https://github.com/bakame-php/csv-doctrine-bridge/blob/master/LICENSE (MIT License)
* @version 1.0.0
* @link https://github.com/bakame-php/csv-doctrine-bridge
* (c) Ignace Nyamagana Butera <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
5 changes: 1 addition & 4 deletions src/functions_include.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
/**
* League CSV Doctrine Collection Bridge (https://github.com/bakame-php/csv-doctrine-bridge)
*
* @author Ignace Nyamagana Butera <[email protected]>
* @license https://github.com/bakame-php/csv-doctrine-bridge/blob/master/LICENSE (MIT License)
* @version 1.0.0
* @link https://github.com/bakame-php/csv-doctrine-bridge
* (c) Ignace Nyamagana Butera <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down

0 comments on commit 5089a96

Please sign in to comment.