Skip to content

Commit 25063ca

Browse files
committed
Fix errors and failing tests
1 parent 592b309 commit 25063ca

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
"yiisoft/yii2": "~2.0.48",
2424
"yiisoft/yii2-gii": "~2.0.0 | ~2.1.0 | ~2.2.0| ~2.3.0",
2525
"laminas/laminas-code": ">=3.4 <=4.13",
26-
"php-openapi/yii2-fractal": "^1.0.0",
26+
"php-openapi/yii2-fractal": "^1.4",
2727
"fakerphp/faker": "^1.9",
2828
"sam-it/yii2-mariadb": "^2.0",
2929
"symfony/var-exporter": "^5.4",
30-
"symfony/polyfill-php80": "^1.30"
30+
"symfony/polyfill-php80": "^1.31"
3131
},
3232
"require-dev": {
3333
"cebe/indent": "*",

src/lib/AttributeResolver.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ protected function resolveJunctionTableProperty(PropertySchema $property, bool $
140140
->setPhpType($junkAttribute['phpType'])
141141
->setDbType($junkAttribute['dbType'])
142142
->setForeignKeyColumnName($property->fkColName)
143-
->setTableName($this->schema->resolveTableName($this->schemaName));
143+
->setTableName($this->componentSchema->resolveTableName($this->schemaName));
144144
$relation = Yii::createObject(AttributeRelation::class, [
145145
$property->getName(),
146146
$junkAttribute['relatedTableName'],
@@ -229,7 +229,7 @@ protected function resolveProperty(
229229
->setIsPrimary($property->isPrimaryKey())
230230
->setForeignKeyColumnName($property->fkColName)
231231
->setFakerStub($this->guessFakerStub($attribute, $property))
232-
->setTableName($this->schema->resolveTableName($this->schemaName));
232+
->setTableName($this->componentSchema->resolveTableName($this->schemaName));
233233
if ($property->isReference()) {
234234
if ($property->isVirtual()) {
235235
throw new InvalidDefinitionException('References not supported for virtual attributes');

src/lib/SchemaToDatabase.php

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use cebe\yii2openapi\generator\ApiGenerator;
1414
use cebe\yii2openapi\lib\exceptions\InvalidDefinitionException;
1515
use cebe\yii2openapi\lib\items\Attribute;
16-
use cebe\yii2openapi\lib\exceptions\InvalidDefinitionException;
1716
use cebe\yii2openapi\lib\items\AttributeRelation;
1817
use cebe\yii2openapi\lib\items\DbModel;
1918
use cebe\yii2openapi\lib\items\JunctionSchemas;

src/lib/items/Attribute.php

+2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
namespace cebe\yii2openapi\lib\items;
99

1010
use cebe\yii2openapi\db\ColumnSchema;
11+
use cebe\yii2openapi\generator\ApiGenerator;
1112
use cebe\yii2openapi\lib\exceptions\InvalidDefinitionException;
1213
use cebe\yii2openapi\lib\helpers\FormatHelper;
1314
use cebe\yii2openapi\lib\openapi\PropertySchema;
15+
use Yii;
1416
use yii\base\BaseObject;
1517
use yii\base\InvalidConfigException;
1618
use yii\base\NotSupportedException;

0 commit comments

Comments
 (0)