Skip to content

#160 refactoring: Merge TableFull-Table Style + Merge MemoryImage-Image #169

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

Merged
merged 8 commits into from
Mar 26, 2014

Conversation

ivanlanin
Copy link
Contributor

Guys, this is part of #160. I propose merging TableFull-Table style and MemoryImage-Image

Benefits:

  • Easier to maintain and enhance
  • Reduce code repetition
  • Allow more features

Consequences:

  • Style\TableFull and Section\MemoryImage is deprecated
  • addMemoryImage is deprecated

Please review. Thanks.

@ivanlanin ivanlanin added the Pull label Mar 25, 2014
$this->_elementCollection[] = $image;
return $image;
} else {
throw new Exception('Src does not exist or invalid image type.');
throw new Exception('Source does not exist or unsupported image type.');
Copy link
Member

Choose a reason for hiding this comment

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

Maybe could you create a new PHPWord Exception ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. Agree.

Copy link
Member

Choose a reason for hiding this comment

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

Else very good job.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I change to InvalidImageException, but I can't create any test case where this will happen since all exceptions will have been handled by the Image class. If this is the case, can we remove this if .. then structure?

Copy link
Member

Choose a reason for hiding this comment

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

If we can't in any case access to the code, you can delete this, because it's a zombie code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. Thanks. I guess that's also the benefit of forcing ourself to create unit tests for our own code: remove useless parts of code.

Copy link
Member

Choose a reason for hiding this comment

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

Exactly :) Good job for your refactoring :) For me, you can merge.

@Progi1984 Progi1984 added this to the 0.9.0 milestone Mar 25, 2014
ivanlanin added a commit that referenced this pull request Mar 26, 2014
#160 refactoring: Merge TableFull-Table Style + Merge MemoryImage-Image
@ivanlanin ivanlanin merged commit 004edd5 into PHPOffice:develop Mar 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants