Skip to content

Fix: Move class into src/ #581

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 1 commit into from
Jun 29, 2022
Merged

Fix: Move class into src/ #581

merged 1 commit into from
Jun 29, 2022

Conversation

localheinz
Copy link
Contributor

@localheinz localheinz commented Jun 28, 2022

This pull request

  • moves a previously introduced class into src/

πŸ’β€β™‚οΈ Given #579, it could make sense to start moving (and extracting additional) classes into src/.

Sooner or later we could even add auto-loading, instead of relying on require statements.

Examples of PSR-4 autoloader implementations can be found here.

@@ -11,7 +11,7 @@ class Entry {
];

const WEBROOT = "https://www.php.net";
const PHPWEB = __DIR__ . '/../';
const PHPWEB = __DIR__ . '/../../';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Run

bin/createNewsEntry

and

bin/createReleaseEntry

to confirm that this still works as expected.

@@ -2,8 +2,9 @@
<?php
PHP_SAPI == 'cli' or die("Please run this script using the cli sapi");

require(__DIR__ . '/../include/news_entry.inc');
use phpweb\news\Entry;
require_once __DIR__ . '/../src/news/Entry.php';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

require_once should also suffice, right?

Copy link
Member

Choose a reason for hiding this comment

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

It's actually better (a second require/include would fail due to class is already defined).

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

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

Thank you!

@kamil-tekiela kamil-tekiela merged commit d6f23ea into php:master Jun 29, 2022
@localheinz
Copy link
Contributor Author

Thank you, @cmb69 and @kamil-tekiela!

@localheinz localheinz deleted the fix/move branch June 29, 2022 18:16
@localheinz localheinz mentioned this pull request Jul 3, 2022
1 task
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

Successfully merging this pull request may close these issues.

3 participants