Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

FIx: Avoid deprecation warning in newer CakePHP version #1777

Merged
merged 1 commit into from
Aug 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Faker/ORM/CakePHP/ColumnTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ public function guessFormat($column, $table)
return $generator->uuid();
};
case 'string':
$columnData = $schema->column($column);
if (method_exists($schema, 'getColumn')) {
$columnData = $schema->getColumn($column);
} else {
$columnData = $schema->column($column);
}
$length = $columnData['length'];
return function () use ($generator, $length) {
return $generator->text($length);
Expand Down