Skip to content

Code refactoring #160

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

Closed
7 tasks done
ivanlanin opened this issue Mar 22, 2014 · 7 comments
Closed
7 tasks done

Code refactoring #160

ivanlanin opened this issue Mar 22, 2014 · 7 comments
Assignees
Milestone

Comments

@ivanlanin
Copy link
Contributor

Since namespace is closing by, here are some issues that I'd like to propose:

  • Change "Section" folder to "Element" since all classes that we put there are not only for "section".
  • Create a "Collection" or "Container" folder for Section, Header, Footer, and other classes that can contain elements. I admit that Cell, Footnote, and TextRun are confusing.
  • Rename "Exceptions" into "Exception". All other folders are in singular forms.
  • Lower case "Tests" into "tests" so we have all root folders in lower cases.
  • Create a parent class for "Container" and "Element". PHP CPD reports too many similiar piece of code.
  • Merge Table and TableFull style. They're the same.
  • Merge Image and MemoryImage element. We can manage to see the difference internally.

Thanks.

@gabrielbull
Copy link
Member

Tests should be test and have a structure like this: test/PhpWord/Tests/*

All source code should be in a directory named src and have a structure like this: src/PhpWord/*

@ivanlanin
Copy link
Contributor Author

Ok. Should we create tests for samples too?

@Progi1984 Progi1984 added this to the 0.9.0 milestone Mar 23, 2014
@gabrielbull
Copy link
Member

No, samples are not really part of the project code base so they should not be tested with the rest of the project

@Progi1984 Progi1984 removed this from the 0.9.0 milestone Mar 24, 2014
@gabrielbull
Copy link
Member

I've done some more research and a lot of libraries seems to have the tests directory names tests so in order to be in tune with the community I am going to rename the test directory to tests. The structure in the directory does not change, it will be tests/PhpWord/Tests/*

@ivanlanin
Copy link
Contributor Author

Ok. I've also seen some projects include their samples for testing. This is one example. I think there's no harm in doing it.

@gabrielbull
Copy link
Member

I guess there is no harm to the project in doing it, just more maintenance and work.

ivanlanin added a commit to ivanlanin/PHPWord that referenced this issue Mar 25, 2014
ivanlanin added a commit to ivanlanin/PHPWord that referenced this issue Mar 26, 2014
ivanlanin added a commit that referenced this issue Mar 26, 2014
#160 refactoring: Merge TableFull-Table Style + Merge MemoryImage-Image
@Progi1984 Progi1984 added this to the 0.9.1 milestone Mar 26, 2014
@ivanlanin ivanlanin self-assigned this Mar 26, 2014
ivanlanin added a commit to ivanlanin/PHPWord that referenced this issue Mar 27, 2014
ivanlanin added a commit to ivanlanin/PHPWord that referenced this issue Mar 27, 2014
ivanlanin added a commit to ivanlanin/PHPWord that referenced this issue Mar 31, 2014
- Rename folder Section to Element
- Rename folder Exceptions to Exception
- Move Section, Header, Footer, Settings to Container folder
- Move Element\Footer\PreserveText to Element\PreserveText
ivanlanin added a commit to ivanlanin/PHPWord that referenced this issue Apr 2, 2014
ivanlanin added a commit to ivanlanin/PHPWord that referenced this issue Apr 6, 2014
ivanlanin added a commit that referenced this issue Apr 8, 2014
#160 Refactor folders: Element, Container, and Exception
@ivanlanin
Copy link
Contributor Author

Closed by #160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants