Giter Club home page Giter Club logo

html-helper's People

Contributors

mikebarlow avatar snsmurf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

html-helper's Issues

Build a Factory

On whichever class is your main entry point to the library, add a factory function that returns a new instance of that object filled with the default implementations of its collaborators. This will cover 95% of the cases for your users and simplify adoption of the library. Users are, of course, free to instantiate the objects themselves if need be, which allows them to swap in different components as necessary.

Generalize Input

It appears that FormData is used to read input. HTTP input isn't necessarily from forms. It could be generated in more ways. The current naming implies some sort of coupling with forms, specifically.

Also, consider that input may not even be coming from a form, but perhaps from a socket, file pointer, etc. I'm not asking you to code against these various other interfaces, but just to design your interface and naming to be general enough that an enterprising person who extends your code could write something against of those these.

Fold snscripts/html-attributes Into This Project

There just doesn't appear to be enough in the other project to justify having it as a separate project. That, and the likelihood that it would be used independently of this project is very low. KISS it, please.

Reorganize Classes/Interfaces

You currently have an Interfaces directory/namespace, but have a mixture of interfaces and classes within that folder. The interfaces aren't clearly called out in their names, so it's all very confusing when looking in the folder or in determining what something is.

I propose that you:

  • Follow items one through three of the PHP-FIG recommendations
  • Split this folder up into more meaningful folders/namespaces. As a general rule of thumb, I've found that if there's a single interface that is supported by multiple classes, those should all go into the same folder. e.g. the snscripts\html-helper\Form namespace would contain FormInterface and some specific implementation of that interface. If you have a hierarchy of interfaces, each of those child interfaces gets its own folder.

Also note that the leading back-slash on a use statement is both unnecessary and undesirable. You can take those off and get slightly better code readability. Consider also not aliasing entities when calling use, unless you have a name conflict. When you use the base name directly, there's less mental processing involved with reading the code. It cuts out a translation step.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.