8000 completes hasSomething & removeSomething methods on the Classgenerator by basz · Pull Request #26 · zendframework/zend-code · GitHub
[go: up one dir, main page]

Skip to content
This repository was 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
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
I would also check against \\ strings...
  • Loading branch information
basz committed Jan 25, 2016
commit 00d9fbec8d9d88a2d1d217dd77b1dbcc2dd525c2
6 changes: 6 additions & 0 deletions src/Generator/ClassGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,10 @@ public function removeExtentedClass()
*/
public function setImplementedInterfaces(array $implementedInterfaces)
{
array_map(function($implementedInterface) {
return (string) TypeGenerator::fromTypeString($implementedInterface);
}, $implementedInterfaces);

$this->implementedInterfaces = $implementedInterfaces;
return $this;
}
Expand All @@ -470,6 +474,7 @@ public function getImplementedInterfaces()
*/
public function hasImplementedInterface($implementedInterface)
{
$implementedInterface = (string) TypeGenerator::fromTypeString($implementedInterface);
return in_array($implementedInterface, $this->implementedInterfaces);
Copy link
Member

Choose a reason for hiding this comment

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

I would also check against \\ strings. Since you are basing against the 7.0 branch, you may want to check the type generator class

}

Expand All @@ -479,6 +484,7 @@ public function hasImplementedInterface($implementedInterface)
*/
public function removeImplementedInterface($implementedInterface)
{
$implementedInterface = (string) TypeGenerator::fromTypeString($implementedInterface);
unset($this->implementedInterfaces[array_search($implementedInterface, $this->implementedInterfaces)]);
return $this;
}
Expand Down
0