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

Some tips for a re-factoring #50

Open
mwjames opened this issue Aug 19, 2017 · 1 comment
Open

Some tips for a re-factoring #50

mwjames opened this issue Aug 19, 2017 · 1 comment

Comments

@mwjames
Copy link

mwjames commented Aug 19, 2017

I know this may not directly merit any functionality provided by RDFIO but if time permits maybe consider the following re-factoring to ease maintenance in future by using some common assumptions about PHP.

  • One class per file
    class RDFIOARC2StoreWrapperException extends MWException {
    }
  • Remove dependency on MWException and use standard exceptions like RuntimeException or classes thereof
  • Move classes (except for scripts) to /src and related sub-directories
    • When moving classes consider using the RDFIO namespace instead of naming each class with RDFIO...
    • Match class names against PSR-4 such as /src/Parser to correspond to RDFIO\Parser\ARC2ToWikiConverter.php
  • For public functions use the public prefix to make visibility more clearer
  • When moving a class try to create a simple unit test to at least cover the constructor (can be extended at any time)
  • For "pure" unit tests avoid MediaWikiTestCase and instead use the standard PHPUnit_Framework_TestCase
  • Documentation such as RDFIOCallGraph.pdf may find a more dedicated location (e.g. /docs)
@samuell
Copy link
Member

samuell commented Aug 19, 2017

Thanks @mwjames , this is great input!

When time permits, will definitely have a go at this!

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

2 participants