Closed forikal-uk closed 6 years ago
GoogleDriveProcessorInterface
with no methods yet.Created:
namespace XmlSquad\Library\GoogleAPI;
interface GoogleDriveProcessorInterface
{
}
XmlSquad\GsheetXml\Application\Service\XmlSerializer
implements that, generic, GoogleDriveProcessorInterface
.Done. (needs committing though).
$ pwd
/Users/jw/Documents/Projects/XmlAuthoringSuite/xml-authoring-project
$ php bin/gsheet-to-xml.php https://drive.google.com/drive/folders/1p-O1y10xMDX_QnWbZd6GE0VcnmWbr_02?ogsrc=32 -r > testing.xml
GoogleDriveProcessService
, GoogleDriveFolderReadService
and GoogleSpreadsheetReadService
from XmlSquad\GsheetXml\Application\Service
into library.Moved.
Replace:
XmlSquad\GsheetXml\Application\Service
to:
XmlSquad\Library\Application\Service
Done.
GoogleDriveProcessorInterface
instead of XmlSerializerInterface
Replace use of :
XmlSquad\GsheetXml\Model\Service\XmlSerializerInterface
, withXmlSquad\Library\GoogleAPI\GoogleDriveProcessorInterface
XmlSquad\GsheetXml\Model\Domain\DomainGSheetObjectFactoryInterface
into library.Replace:
XmlSquad\GsheetXml\Model\Domain\DomainGSheetObjectFactoryInterface
, withXmlSquad\Library\Model\Domain\DomainGSheetObjectFactoryInterface
GoogleDriveProcessService
so that GoogleDriveProcessorInterface
is injected in the process methods as opposed to constructor (to allow the same GoogleDriveProcessService
object instance to be used for different processes).public method signatures changed:
__construct
googleUrlToXml
$ pwd
/Users/x/Documents/Projects/XmlAuthoringSuite/xml-authoring-project
$ ./vendor/phpunit/phpunit/phpunit vendor/xmlsquad/gsheet-to-xml/tests/
PHPUnit 7.4.0 by Sebastian Bergmann and contributors.
..... 5 / 5 (100%)
Time: 50 ms, Memory: 4.00MB
OK (5 tests, 23 assertions)
The test script ought to be moved to the library too.
Done.
$ pwd
/Users/x/Documents/Projects/XmlAuthoringSuite/xml-authoring-project
$ ./vendor/phpunit/phpunit/phpunit
PHPUnit 7.4.0 by Sebastian Bergmann and contributors.
................................................................. 65 / 65 (100%)
Time: 2.23 seconds, Memory: 12.00MB
OK (65 tests, 1290 assertions)
Good.
XmlSquad\GsheetXml\Application\Service\XmlSerializer
method names so it conforms to any kind of process on the Google Drive entities.Done.
The method being invoked on the processor is now called:
$googleDriveProcessor->processDomainGSheetObjects($domainGSheetObjects)
and the service has a public method called
processGoogleUrl
GoogleDriveProcessorInterface
.So, really we need to move it from
XmlSquad\GsheetXml\Model\Service\XmlSerializerInterface
which is now redundant.
XmlSerializerInterface
See comment above.
Done.
Done
In project:
$ pwd
/Users/x/Documents/Projects/XmlAuthoringSuite/xml-authoring-project
$ composer status -v
You have version variations in the following dependencies:
/Users/x/Documents/Projects/XmlAuthoringSuite/xml-authoring-project/vendor/xmlsquad/gsheet-to-xml:
From dev-master to dev-master
/Users/x/Documents/Projects/XmlAuthoringSuite/xml-authoring-project/vendor/xmlsquad/xml-authoring-library:
From dev-master to dev-master
Update composer in project
$ composer update --prefer-source
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals
- Updating xmlsquad/gsheet-to-xml dev-master (4961593 => 567dfca): Checking out 567dfcaa82
- Updating xmlsquad/xml-authoring-library dev-master (eee0223 => 36c23af): Checking out 36c23af87e
Writing lock file
Generating autoload files
Test the gsheet-to-xml command
$ pwd
/Users/x/Documents/Projects/XmlAuthoringSuite/xml-authoring-project
$ php bin/gsheet-to-xml.php https://drive.google.com/drive/folders/13_CYrzBCTxjtq048-3MTiqlNjRfqzxXj?ogsrc=32 -r > testing.xml
Good
Run tests
$ pwd
/Users/x/Documents/Projects/XmlAuthoringSuite/xml-authoring-project
./vendor/phpunit/phpunit/phpunit
PHPUnit 7.4.0 by Sebastian Bergmann and contributors.
................................................................. 65 / 65 (100%)
Time: 2.86 seconds, Memory: 12.00MB
OK (65 tests, 1290 assertions)
All good.
Goal
See issue summary
Why
Aside from the
$xmlSerializer
, the followingXmlSquad\GsheetXml\Application\Service
classes:GoogleDriveFolderReadService
GoogleSpreadsheetReadService
, andGoogleDriveProcessService
...no longer contain logic that is exclusive to converting a gsheet-to-xml. They could be made to do any kind of process on a gsheet in drive.
How
GoogleDriveProcessorInterface
with no methods yet.XmlSquad\GsheetXml\Application\Service\XmlSerializer
implements that, generic,GoogleDriveProcessorInterface
.GoogleDriveProcessService
,GoogleDriveFolderReadService
andGoogleSpreadsheetReadService
into library.GoogleDriveProcessService
so thatGoogleDriveProcessorInterface
is injected in the process methods as opposed to constructor (to allow the sameGoogleDriveProcessService
to be used for different processes).XmlSquad\GsheetXml\Application\Service\XmlSerializer
method names so it conforms to any kind of process on the Google Drive entities.GoogleDriveProcessorInterface
.