Skip to content

Commit

Permalink
Update explanation in BrokenEncapsulationDataProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
danon committed Nov 24, 2023
1 parent ddd4b43 commit 52dbf03
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Internal/BrokenEncapsulationDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@
use TRegx\PhpUnit\DataProviders\Internal\Frame\DataRow;

/**
* {@see DataProvider} is the library's public interface,
* {@see DataProvider} is the library's public interface
* intended to be passed to PhpUnit in "@dataProvider" annotation.
*
* Additionally, it can also be passed back into other the library
* Additionally, it can also be passed back into other library
* entry points, to be crossed, zipped or joined. In order to properly
* present array keys without scraping strings, we need to access
* the datasets from the {@see DataProvider} internals..
* present array keys without scraping string keys, we need to access
* the datasets from the {@see DataProvider} internals.
*
* An alternative would be to expose two classes - one with entry point
* facade methods, and the other one being the data provider object.
* Out of two evils, protected method {@see DataProvider::dataset()} is
* probably the more suitable choice.
*
* Another alternative would be to parse string keys, to be represented
* internally, and to be rendered as string keys again.
*
* {@see DataProvider::dataset()} should remain a protected method,
* not to unnecessarily confuse users of the interface with the method.
* {@see DataProvider::dataset()} is not supposed to be called by the
Expand All @@ -26,7 +29,7 @@
* entry points.
*
* Class {@see BrokenEncapsulationDataProvider} extends {@see DataProvider}
* to access {@see DataProvider::dataset()} without, using unhealthy
* to access {@see DataProvider::dataset()} without using unhealthy
* hacks.
*/
class BrokenEncapsulationDataProvider extends DataProvider
Expand Down

0 comments on commit 52dbf03

Please sign in to comment.