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

Put each class into its own file without side-effects #90

Open
szepeviktor opened this issue Feb 28, 2021 · 3 comments
Open

Put each class into its own file without side-effects #90

szepeviktor opened this issue Feb 28, 2021 · 3 comments

Comments

@szepeviktor
Copy link

What you think about that?
Something similar to PSR-4.

@beaulebens
Copy link
Owner

What would that end up looking like?

And why would we be doing it? (what are you aiming to accomplish?)

@szepeviktor
Copy link
Author

szepeviktor commented Mar 14, 2021

What would that end up looking like?

Like a Composer package.

And why would we be doing it? (what are you aiming to accomplish?)

PSR-4 is beneficial. For example would enable simple and predictable autoloading.
Namespace and class name structure would be the same as the file structure.
e.g. Keyring\Service\Fitbit would live in src/Service/Fitbit.php

Basically leaving legacy technologies behind. E.g. wave goodbye to require statements.

BTW You may be interested in the results of this research: https://github.com/szepeviktor/small-project/blob/master/MAIN-FILE-PARTS.md

@szepeviktor
Copy link
Author

Annotation based hooking is like a paradigm shift for us WordPress people.

    /**
     * @hook wp_insert_post 1000
     */
    public function onInsertPost(int $postId, WP_Post $post, bool $update): void

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