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

completes hasSomething & removeSomething methods on the Classgenerator #26

Closed
wants to merge 21 commits into from

Conversation

basz
Copy link
Contributor

@basz basz commented Dec 2, 2015

This PR introduces removeSomething and hasSomething methods to the ClassGenerator and it's helpers classes.

@basz
Copy link
Contributor Author

basz commented Dec 26, 2015

Any chance this will get merged?

@Ocramius
Copy link
Member

Ocramius commented Jan 5, 2016

@basz just checked this again: question, are remove* methods globally common among all of the generator classes? I don't want to introduce more inconsistencies in this already fairly riddled codebase.

@Ocramius Ocramius self-assigned this Jan 5, 2016
@Ocramius Ocramius added this to the 2.7.0 milestone Jan 5, 2016
@basz
Copy link
Contributor Author

basz commented Jan 5, 2016

I added it to complement removeMethod (same class).

Whether it is consistently a common thing,.. it doesn't seem to be - but I do see some remove references.

@Ocramius
Copy link
Member

Ocramius commented Jan 7, 2016

@basz can you complete the API for the remove* methods on the generators then?

@basz
Copy link
Contributor Author

basz commented Jan 8, 2016

@Ocramius I just added some remove* and has* methods for simple cases

see also #33

remaining methods proxy to TraitUsageGenerator

see

@basz basz changed the title Feature/remove class property WIP completes hasSomething & removeSomething methods on the Classgenerator Jan 12, 2016
*/
protected $traitUsageGenerator;
Copy link
Member

Choose a reason for hiding this comment

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

This is a BC break

@basz
Copy link
Contributor Author

basz commented Jan 13, 2016

I am done with this PR, review (please)

the ones still missing are removeTraitAlias & hasTraitAlias, but...

@basz basz changed the title WIP completes hasSomething & removeSomething methods on the Classgenerator completes hasSomething & removeSomething methods on the Classgenerator Jan 13, 2016
@samsonasik
Copy link
Contributor

need rebase

@basz basz force-pushed the feature/remove-class-property branch from e6d678d to 6e7f0c6 Compare January 14, 2016 23:15
*/
public function hasExtentedClass()
{
return !empty($this->extendedClass);
Copy link
Member

Choose a reason for hiding this comment

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

if empty() is used to compare against null, then use null !== $this->extendedClass instead, as an empty string would pass this check (and would be invalid)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if (!empty($this->extendedClass)) {
    $output .= ' extends ' . $this->extendedClass;
}

both null and "" should be false.

This was present. I just reused...

@Ocramius Ocramius modified the milestones: 3.1.0, 2.7.0 Jan 24, 2016
@basz
Copy link
Contributor Author

basz commented Feb 4, 2016

@Ocramius what's the plan for this?

You mentioned refactoring TraitUsageGenerator::$uses which now is an strongly typed representation

Can we merge this in 3 (ugly but it works) and refactor that for 4.0?

@Ocramius
Copy link
Member

Totally missed this PR, sorry @basz. Merging into develop now.

Ocramius added a commit that referenced this pull request Sep 20, 2016
@Ocramius
Copy link
Member

Merged into develop via 3a9ec93

Thanks @basz!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants