Skip to content

Commit

Permalink
Fix scrut bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jcheron committed Jan 25, 2020
1 parent 39c1896 commit 9080396
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ filter:
- src/Ubiquity/controllers/admin/
- src/Ubiquity/annotations/
- src/Ubiquity/utils/git/UGitRepository.php
- src/Ubiquity/cache/Preloader.php
- src/Ubiquity/cache/preloading/
checks:
php:
code_rating: true
Expand Down
1 change: 0 additions & 1 deletion src/Ubiquity/orm/bulk/BulkUpdates.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*
*/
class BulkUpdates extends AbstractBulks {
private $sql;

public function __construct($className) {
parent::__construct ( $className );
Expand Down
8 changes: 4 additions & 4 deletions src/Ubiquity/orm/traits/DAOBulkUpdatesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
* This class is part of Ubiquity
*
* @author jcheron <myaddressmail@gmail.com>
* @version 1.0.0
* @version 1.0.1
*
*/
trait DAOBulkUpdatesTrait {
protected static $bulks = [ 'insert' => [ ],'update' => [ ],'delete' => [ ] ];

protected static function getBulk($instance, $class, $operation = 'update') {
protected static function getBulk($class, $operation = 'update') {
if (! isset ( self::$bulks [$operation] [$class] )) {
$bulkClass = '\\Ubiquity\\orm\\bulk\\Bulk' . \ucfirst ( $operation ) . 's';
self::$bulks [$operation] [$class] = new $bulkClass ( $class );
Expand All @@ -23,14 +23,14 @@ protected static function getBulk($instance, $class, $operation = 'update') {

protected static function toOperation($instance, string $operation): void {
$class = \get_class ( $instance );
self::getBulk ( $instance, $class, $operation )->addInstance ( $instance );
self::getBulk ( $class, $operation )->addInstance ( $instance );
}

protected static function toOperations(array $instances, string $operation): void {
$instance = \current ( $instances );
if (isset ( $instance )) {
$class = \get_class ( $instance );
self::getBulk ( $instance, $class, $operation )->addInstances ( $instances );
self::getBulk ( $class, $operation )->addInstances ( $instances );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Ubiquity/orm/traits/DAOCoreTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected static function _getAll(Database $db, $className, ConditionParser $con

$metaDatas = OrmUtils::getModelMetadata ( $className );
$tableName = $metaDatas ['#tableName'];
if ($hasIncluded = $included || (\is_array ( $included ) && \sizeof ( $included ) > 0)) {
if ($hasIncluded = ($included || (\is_array ( $included ) && \sizeof ( $included ) > 0))) {
self::_initRelationFields ( $included, $metaDatas, $invertedJoinColumns, $oneToManyFields, $manyToManyFields );
}
$transformers = $metaDatas ['#transformers'] [self::$transformerOp] ?? [ ];
Expand Down

0 comments on commit 9080396

Please sign in to comment.