Skip to content

DOC Document correct method signature for DB::require_table#11425

Open
maxime-rainville wants to merge 1 commit intosilverstripe:5from
archiprocode:pull/5/doc-db-require-table-signature
Open

DOC Document correct method signature for DB::require_table#11425
maxime-rainville wants to merge 1 commit intosilverstripe:5from
archiprocode:pull/5/doc-db-require-table-signature

Conversation

@maxime-rainville
Copy link
Copy Markdown
Contributor

The method signature for DB::require_table is wrong and should match the one from DBSchemaManager::requireTable.

I've documented the return type for both method while I was in there.

Parent issue

Comment thread src/ORM/DB.php Outdated
Comment on lines +553 to +554
* @param array $fieldSchema A list of the fields to create, in the same form as DataObject::$db
* @param array $indexSchema A list of indexes to create. See {@link requireIndex()}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param array $fieldSchema A list of the fields to create, in the same form as DataObject::$db
* @param array $indexSchema A list of indexes to create. See {@link requireIndex()}
* @param array|null $fieldSchema A list of the fields to create, in the same form as DataObject::$db
* @param array|null $indexSchema A list of indexes to create. See {@link requireIndex()}

null is the default value for these parameters

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, looks like you put the null in the wrong place.

Comment thread src/ORM/DB.php Outdated
Comment thread src/ORM/DB.php Outdated
Comment thread src/ORM/DB.php Outdated
@maxime-rainville maxime-rainville force-pushed the pull/5/doc-db-require-table-signature branch from 21e71ce to 9b8169f Compare October 22, 2024 08:22
Comment thread src/ORM/DB.php
Comment on lines +553 to +554
* @param array $fieldSchema|null A list of the fields to create, in the same form as DataObject::$db
* @param array $indexSchema|null A list of indexes to create. See {@link require_index()}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param array $fieldSchema|null A list of the fields to create, in the same form as DataObject::$db
* @param array $indexSchema|null A list of indexes to create. See {@link require_index()}
* @param array|null $fieldSchema A list of the fields to create, in the same form as DataObject::$db
* @param array|null $indexSchema A list of indexes to create. See {@link require_index()}

@GuySartorelli
Copy link
Copy Markdown
Member

@maxime-rainville Do you think you'll have a chance to resolve the outstanding requested changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants