Passed
Push — master ( 56f68a...27f0d4 )
by Hector Luis
09:13
created
Entity/Resource/Collection/Base.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,15 +40,15 @@
 block discarded – undo
40 40
         LoggerInterface $logger,
41 41
         FetchStrategyInterface $fetchStrategy,
42 42
         ManagerInterface $eventManager,
43
-        AdapterInterface $connection = null,
44
-        AbstractDb $resource = null,
43
+        AdapterInterface $connection=null,
44
+        AbstractDb $resource=null,
45 45
         string $idFieldName,
46 46
         string $model,
47 47
         string $resourceModel
48 48
     ) {
49
-        $this->_idFieldName = $idFieldName;
50
-        $this->_model = $model;
51
-        $this->_resourceModel = $resourceModel;
49
+        $this->_idFieldName=$idFieldName;
50
+        $this->_model=$model;
51
+        $this->_resourceModel=$resourceModel;
52 52
         parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource);
53 53
     }
54 54
 
Please login to merge, or discard this patch.
Entity/Resource/Base.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@
 block discarded – undo
31 31
      */
32 32
     public function __construct(
33 33
         ParentContext $context,
34
-        $connectionName = null,
34
+        $connectionName=null,
35 35
         string $tableName,
36 36
         string $referenceId
37 37
     ) {
38
-        $this->tableName = $tableName;
39
-        $this->referenceId = $referenceId;
38
+        $this->tableName=$tableName;
39
+        $this->referenceId=$referenceId;
40 40
         parent::__construct($context, $connectionName);
41 41
     }
42 42
 
Please login to merge, or discard this patch.
Entity/Base.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,14 +38,14 @@  discard block
 block discarded – undo
38 38
     public function __construct(
39 39
         Context $context,
40 40
         Registry $registry,
41
-        AbstractResource $resource = null,
42
-        AbstractDb $resourceCollection = null,
41
+        AbstractResource $resource=null,
42
+        AbstractDb $resourceCollection=null,
43 43
         string $resourceModelClass,
44 44
         string $cacheTag,
45
-        array $data = []
45
+        array $data=[]
46 46
     ) {
47
-        $this->resourceModelClass = $resourceModelClass;
48
-        $this->cacheTag = $cacheTag;
47
+        $this->resourceModelClass=$resourceModelClass;
48
+        $this->cacheTag=$cacheTag;
49 49
         parent::__construct($context, $registry, $resource, $resourceCollection, $data);
50 50
     }
51 51
 
@@ -56,6 +56,6 @@  discard block
 block discarded – undo
56 56
 
57 57
     public function getIdentities()
58 58
     {
59
-        return [$this->cacheTag . '_' . $this->getId()];
59
+        return [$this->cacheTag.'_'.$this->getId()];
60 60
     }
61 61
 }
Please login to merge, or discard this patch.
Repository/Base/BaseRepository.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
         ObjectManagerInterface $objectManager
55 55
     ) {
56 56
 
57
-        $this->object = $object;
58
-        $this->collection = $collection;
59
-        $this->searchResultsFactory = $searchResultsFactory;
60
-        $this->objectManager = $objectManager;
57
+        $this->object=$object;
58
+        $this->collection=$collection;
59
+        $this->searchResultsFactory=$searchResultsFactory;
60
+        $this->objectManager=$objectManager;
61 61
     }
62 62
 
63 63
     /**
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     public function getById($id)
80 80
     {
81
-        $object = $this->objectManager->create($this->object);
81
+        $object=$this->objectManager->create($this->object);
82 82
         try {
83 83
             $object->load($id);
84 84
             if (!$object->getId()) {
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      */
96 96
     public function getSingle(SearchCriteriaInterface $criteria)
97 97
     {
98
-        $list = $this->getList($criteria);
98
+        $list=$this->getList($criteria);
99 99
         return $list->getTotalCount() > 0 ? $list->getItems()[0] : null;
100 100
     }
101 101
 
@@ -104,23 +104,23 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function getList(SearchCriteriaInterface $criteria): SearchResultsInterface
106 106
     {
107
-        $searchResults = $this->searchResultsFactory->create();
107
+        $searchResults=$this->searchResultsFactory->create();
108 108
         $searchResults->setSearchCriteria($criteria);
109
-        $collection = $this->objectManager->create($this->collection);
109
+        $collection=$this->objectManager->create($this->collection);
110 110
         foreach ($criteria->getFilterGroups() as $filterGroup) {
111
-            $fields = [];
112
-            $conditions = [];
111
+            $fields=[];
112
+            $conditions=[];
113 113
             foreach ($filterGroup->getFilters() as $filter) {
114
-                $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq';
115
-                $fields[] = $filter->getField();
116
-                $conditions[] = [$condition => $filter->getValue()];
114
+                $condition=$filter->getConditionType() ? $filter->getConditionType() : 'eq';
115
+                $fields[]=$filter->getField();
116
+                $conditions[]=[$condition => $filter->getValue()];
117 117
             }
118 118
             if ($fields) {
119 119
                 $collection->addFieldToFilter($fields, $conditions);
120 120
             }
121 121
         }
122 122
         $searchResults->setTotalCount($collection->getSize());
123
-        $sortOrders = $criteria->getSortOrders();
123
+        $sortOrders=$criteria->getSortOrders();
124 124
         if ($sortOrders) {
125 125
             /** @var SortOrder $sortOrder */
126 126
             foreach ($sortOrders as $sortOrder) {
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
         }
133 133
         $collection->setCurPage($criteria->getCurrentPage());
134 134
         $collection->setPageSize($criteria->getPageSize());
135
-        $objects = [];
135
+        $objects=[];
136 136
         foreach ($collection as $objectModel) {
137
-            $objects[] = $objectModel;
137
+            $objects[]=$objectModel;
138 138
         }
139 139
         $searchResults->setItems($objects);
140 140
         return $searchResults;
@@ -147,11 +147,11 @@  discard block
 block discarded – undo
147 147
      */
148 148
     public function delete($object): array
149 149
     {
150
-        $result = ['success' => true, 'message' => 'successfully deleted!!!'];
150
+        $result=['success' => true, 'message' => 'successfully deleted!!!'];
151 151
         try {
152 152
             $object->delete();
153 153
         } catch (Throwable $exception) {
154
-            $result = ['success' => false, 'message' => $exception->getMessage()];
154
+            $result=['success' => false, 'message' => $exception->getMessage()];
155 155
         }
156 156
         return $result;
157 157
     }
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
      */
162 162
     public function deleteById($id): array
163 163
     {
164
-        $object = $this->getById($id);
165
-        $result = $this->delete($object);
164
+        $object=$this->getById($id);
165
+        $result=$this->delete($object);
166 166
         return $result;
167 167
     }
168 168
 }
Please login to merge, or discard this patch.