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

T14584 factories #14592

Merged
merged 6 commits into from
Dec 7, 2019
Merged

T14584 factories #14592

merged 6 commits into from
Dec 7, 2019

Conversation

niden
Copy link
Member

@niden niden commented Dec 7, 2019

Hello!

In raising this pull request, I confirm the following:

  • I have read and understood the Contributing Guidelines

  • I have checked that another pull request for this purpose does not exist

  • I wrote some tests for this PR

  • I have updated the relevant CHANGELOG

  • I have created a PR for the documentation about this change

  • Fixed factories to return a new instance when calling newInstance and not a cached one from the internal mapper

    • Phalcon/Annotations/AnnotationsFactory
    • Phalcon/Cache/AdapterFactory
    • Phalcon/Config/ConfigFactory
    • Phalcon/Db/Adapter/PdoFactory
    • Phalcon/Image/ImageFactory
    • Phalcon/Logger/AdapterFactory
    • Phalcon/Paginator/PaginatorFactory
    • Phalcon/Storage/AdapterFactory
    • Phalcon/Storage/SerializerFactory
    • Phalcon/Translate/InterpolatorFactory
    • Phalcon/Translate/TranslateFactory
    • Phalcon/Validation/ValidatorFactory

Thanks

@niden niden added 4.0 labels Dec 7, 2019
@codecov
Copy link

codecov bot commented Dec 7, 2019

Codecov Report

Merging #14592 into 4.0.x will decrease coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##            4.0.x   #14592      +/-   ##
==========================================
- Coverage   67.75%   67.72%   -0.03%     
==========================================
  Files         488      488              
  Lines      112710   112590     -120     
==========================================
- Hits        76368    76256     -112     
+ Misses      36342    36334       -8

Copy link
Member

@ruudboon ruudboon left a comment

Choose a reason for hiding this comment

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

Can you add a test as well?
I already had this pending. Can also submit it after merging.

/**
     * Tests issue 14584. Use load twice
     *
     * @author Ruud Boon <team@phalcon.io>
     * @since  2019-12-06
     */
    public function loadTwice(UnitTester $I)
    {
        $I->wantToTest('Config\ConfigFactory - load() - issue 14584');

        $factory = new ConfigFactory();
        $configFile1 = dataDir('assets/config/config.php');
        $config = $factory->load($configFile1);

        $I->assertEquals("/phalcon/", $config->phalcon->baseUri);

        $configFile2 = dataDir('assets/config/config-2.php');
        $config2 = $factory->load($configFile2);

        $I->assertEquals("/phalcon4/", $config2->phalcon->baseUri);
    }

@niden
Copy link
Member Author

niden commented Dec 7, 2019

Test added

Copy link
Member

@ruudboon ruudboon left a comment

Choose a reason for hiding this comment

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

Can you copy assets/config/config.php to assets/config/config-2.php and change phalcon to phalcon4?
https://github.com/phalcon/cphalcon/tree/4.0.x/tests/_data/assets/config

@niden niden merged commit 3413428 into phalcon:4.0.x Dec 7, 2019
@niden niden deleted the T14584-factories branch December 7, 2019 16:43
@niden niden added bug A bug report status: low Low and removed Bug - Low labels Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: low Low
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants