Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set / get docblock is broken #97

Closed
maboiteaspam opened this issue Jun 26, 2014 · 3 comments
Closed

set / get docblock is broken #97

maboiteaspam opened this issue Jun 26, 2014 · 3 comments

Comments

@maboiteaspam
Copy link

        /**
         * Setter method, allows $model->set('property', 'value') access to data.
         *
         * @param  string|array $property
         * @param  string|null  $value
         * @return void
         */
        public function set($property, $value = null) {
            $this->orm->set($property, $value);
            return $this;
        }

        /**
         * Setter method, allows $model->set_expr('property', 'value') access to data.
         *
         * @param  string|array $property
         * @param  string|null  $value
         * @return void
         */
        public function set_expr($property, $value = null) {
            $this->orm->set_expr($property, $value);
            return $this;
        }

void instead of Model.

@tag
Copy link
Contributor

tag commented Aug 21, 2014

Yes, Model is the correct return type for set_expr().

However, I'm not convinced set() should return Model, as you've done in the PR #99 (changing not just the docblock but the actual return value as well), even at the expense of chaining. This is because __set(), which naturally has a return type of void, calls set().

If it were to return anything other than void, set() should return the $value (which is which in practice is mixed, although the docblock indicates string|null).

@tag
Copy link
Contributor

tag commented Aug 21, 2014

Heh. Although now that I've said the above, I see the develop branch has already modified set() to permit chaining. See #94.

@treffynnon
Copy link
Collaborator

Closed with the merge of #99.

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

No branches or pull requests

3 participants