Skip to content

Update code standards #106

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
Jan 27, 2021
Merged

Update code standards #106

merged 1 commit into from
Jan 27, 2021

Conversation

TavoNiievez
Copy link
Member

No description provided.

@TavoNiievez TavoNiievez added this to the 2.0.0 milestone Jan 25, 2021
$autoLoader = codecept_root_dir() . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

if (file_exists($autoLoader)) {
require_once $autoLoader;
Copy link
Member

Choose a reason for hiding this comment

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

This code is odd, I think its only purpose was to get CI working, because it runs composer install in two separate directories.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it seems that it is, and it is still necessary... if I remove it I get:
PHP Fatal error: Uncaught Error: Class 'Symfony\Component\HttpKernel\Kernel' not found in /home/runner/work/module-symfony/module-symfony/framework-tests/src/Kernel.php:12
So I opted to encapsulate it in a separate method improving its documentation:

    /**
     * Ensures autoloader loading of additional directories.
     * It is only required for CI jobs to run correctly.
     */
    private function requireAdditionalAutoloader(): void
    {
        $autoLoader = codecept_root_dir() . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
        if (file_exists($autoLoader)) {
            require_once $autoLoader;
        }
    }

@TavoNiievez TavoNiievez changed the title Update dependencies and code standards Update code standards Jan 27, 2021
@TavoNiievez TavoNiievez marked this pull request as ready for review January 27, 2021 19:45
@TavoNiievez TavoNiievez merged commit 27ea512 into Codeception:master Jan 27, 2021
@TavoNiievez TavoNiievez deleted the update-depend-and-standars branch January 27, 2021 21:45
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.

2 participants