Conversation
…s which do not add valuable information
…tain multiple spaces between the tag, type and description
… are impossible in current implementation
…e the ? symbol present
Completed type hinting and added PHP 7.2 standards.
|
This PR provides changes described in #362 |
michalbundyra
left a comment
There was a problem hiding this comment.
Hi! I haven't review the whole PR (yet), but I caught some major issues with it which are repeated in the whole PR.
The PR has also some conflicts which needs to be resolved.
.gitignore
Outdated
| @@ -1,3 +1,4 @@ | |||
| .idea/ | |||
There was a problem hiding this comment.
We shouldn't have any IDE/OS specific files/directories here. Please revert and add it to your global .gitignore.
src/Sql/AbstractSql.php
Outdated
| /** | ||
| * @var string | ||
| */ | ||
| /** @var string[] */ |
There was a problem hiding this comment.
this is invalid type, values are mixed, keys are sting
src/Sql/AbstractSql.php
Outdated
| public function getSqlString(?PlatformInterface $adapterPlatform = null) : string | ||
| { | ||
| $adapterPlatform = ($adapterPlatform) ?: new DefaultAdapterPlatform; | ||
| $adapterPlatform = $adapterPlatform ?: new DefaultAdapterPlatform; |
There was a problem hiding this comment.
add parenthesis on class instantiation
There was a problem hiding this comment.
not these parentheses - on class instantiation so it should be: new DefaultAdapterPlatform()
There was a problem hiding this comment.
Sorry about that - I guess I am starring at the code for too long 😆
src/Sql/AbstractSql.php
Outdated
| DriverInterface $driver = null, | ||
| ParameterContainer $parameterContainer = null | ||
| ) { | ||
| PlatformInterface $platform, |
There was a problem hiding this comment.
I am not sure about this parameters alignment, but if we are gonna go that way here we are missing on space
src/Sql/AbstractSql.php
Outdated
| // expression data) | ||
| $values = $part[1]; | ||
| $types = isset($part[2]) ? $part[2] : []; | ||
| $types = isset($part[2]) ? $part[2] : []; |
There was a problem hiding this comment.
PHP 7.2 - use: $part[2] ?? []
| $decimal = null, | ||
| $nullable = false, | ||
| $default = null, | ||
| string $name = '', |
There was a problem hiding this comment.
why we have default value here?
There was a problem hiding this comment.
The original Column.php setName method is a bit confusing. Not sure which way to go here.
There was a problem hiding this comment.
I can leave the null option in the constructor as it was and handle the null parameter in the setter to ensure '' (empty string)
or
force at least an empty string in the constructor.
Any good ideas here?
src/Sql/Ddl/Column/Column.php
Outdated
| * @param mixed[] $options | ||
| */ | ||
| public function __construct($name = null, $nullable = false, $default = null, array $options = []) | ||
| public function __construct(string $name = '', bool $nullable = false, ?$default = null, array $options = []) |
There was a problem hiding this comment.
changed default value for $name, I think it should be noted
src/Sql/Ddl/Column/Column.php
Outdated
| * @param mixed[] $options | ||
| */ | ||
| public function __construct($name = null, $nullable = false, $default = null, array $options = []) | ||
| public function __construct(string $name = '', bool $nullable = false, ?$default = null, array $options = []) |
There was a problem hiding this comment.
again: question mark before variable name (missing type?)
src/Sql/Ddl/Column/Column.php
Outdated
| * @return self | ||
| */ | ||
| public function setDefault($default) | ||
| public function setDefault(?$default) : self |
There was a problem hiding this comment.
also here, question mark, please check all places
There was a problem hiding this comment.
changed back, but open for discussion based on the PSR-12 draft
src/Sql/Ddl/CreateTable.php
Outdated
| * @param PlatformInterface $adapterPlatform | ||
| * | ||
| * @return string[][]|null | ||
| * @return string[][]|void |
There was a problem hiding this comment.
I think we are trying to avoid that, and do not mix void with the other type
# Conflicts: # src/Sql/Select.php
|
@webimpress Thanks for the feedback. There are quite a few cs breaks which have not been introduced by this PR. Instead of the laborious manual work of comparing and fixing everything, I suggest to either update |
|
Ok folks, that's it for now. |
|
This repository has been closed and moved to laminas/laminas-db; a new issue has been opened at laminas/laminas-db#9. |
|
This repository has been moved to laminas/laminas-db. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:
|
Provide a narrative description of what you are trying to accomplish:
Are you fixing a bug?
masterbranch, and submit against that branch.CHANGELOG.mdentry for the fix.Are you creating a new feature?
developbranch, and submit against that branch.CHANGELOG.mdentry for the new feature.Is this related to quality assurance?
Is this related to documentation?