-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from eclipxe13/ft/metadatalist-messages
Deprecación de `MaximumRecordsHandler` a favor de `MetadataMessageHandler`
- Loading branch information
Showing
20 changed files
with
420 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phive xmlns="https://phar.io/phive"> | ||
<phar name="php-cs-fixer" version="^3.20.0" installed="3.20.0" location="./tools/php-cs-fixer" copy="false"/> | ||
<phar name="php-cs-fixer" version="^3.40.0" installed="3.40.0" location="./tools/php-cs-fixer" copy="false"/> | ||
<phar name="phpcs" version="^3.7.2" installed="3.7.2" location="./tools/phpcs" copy="false"/> | ||
<phar name="phpcbf" version="^3.7.2" installed="3.7.2" location="./tools/phpcbf" copy="false"/> | ||
<phar name="phpstan" version="^1.10.22" installed="1.10.22" location="./tools/phpstan" copy="false"/> | ||
<phar name="composer-normalize" version="^2.32.0" installed="2.32.0" location="./tools/composer-normalize" copy="false"/> | ||
<phar name="phpstan" version="^1.10.46" installed="1.10.46" location="./tools/phpstan" copy="false"/> | ||
<phar name="composer-normalize" version="^2.39.0" installed="2.39.0" location="./tools/composer-normalize" copy="false"/> | ||
</phive> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpCfdi\CfdiSatScraper\Contracts; | ||
|
||
use DateTimeImmutable; | ||
|
||
interface MetadataMessageHandler | ||
{ | ||
/** | ||
* Ocurre cuando se resolvió una consulta entre dos momentos en un mismo día, siempre serán menos de 500 registros. | ||
*/ | ||
public function resolved(DateTimeImmutable $since, DateTimeImmutable $until, int $count): void; | ||
|
||
/** | ||
* Ocurre cuando se resolvió una consulta de un día determinado. | ||
* Hay un momento inicial y otro final porque las horas podrían ser diferentes a 00:00:00 y 23:59:59. | ||
*/ | ||
public function date(DateTimeImmutable $since, DateTimeImmutable $until, int $count): void; | ||
|
||
/** | ||
* Ocurre cuando se encontraron 500 registros en un periodo. | ||
* Se dividirá la consulta para intentar descargar el contenido completo. | ||
*/ | ||
public function divide(DateTimeImmutable $since, DateTimeImmutable $until): void; | ||
|
||
/** | ||
* Ocurre cuando se encontraron 500 registros en un solo segundo. | ||
*/ | ||
public function maximum(DateTimeImmutable $moment): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpCfdi\CfdiSatScraper\Internal; | ||
|
||
use DateTimeImmutable; | ||
use PhpCfdi\CfdiSatScraper\Contracts\MaximumRecordsHandler; | ||
use PhpCfdi\CfdiSatScraper\NullMetadataMessageHandler; | ||
|
||
/** | ||
* This class wraps a MaximumRecordsHandler into a MetadataMessageHandler. | ||
* This class will be removed on version 4.0.0 | ||
* | ||
* @internal | ||
*/ | ||
final class MaximumRecordsHandlerWrapper extends NullMetadataMessageHandler | ||
{ | ||
/** @var MaximumRecordsHandler */ | ||
private $maximumRecordsHandler; | ||
|
||
public function __construct(MaximumRecordsHandler $maximumRecordsHandler) | ||
{ | ||
$this->maximumRecordsHandler = $maximumRecordsHandler; | ||
} | ||
|
||
/** @noinspection PhpMissingParentCallCommonInspection */ | ||
public function maximum(DateTimeImmutable $moment): void | ||
{ | ||
$this->maximumRecordsHandler->handle($moment); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpCfdi\CfdiSatScraper\Internal; | ||
|
||
use DateTimeImmutable; | ||
use PhpCfdi\CfdiSatScraper\Contracts\MaximumRecordsHandler; | ||
use PhpCfdi\CfdiSatScraper\Contracts\MetadataMessageHandler; | ||
|
||
/** | ||
* This class wraps a MetadataMessageHandler into a MaximumRecordsHandler. | ||
* This class will be removed on version 4.0.0 | ||
* | ||
* @internal | ||
*/ | ||
final class MetadataMessageHandlerWrapper implements MaximumRecordsHandler | ||
{ | ||
/** @var MetadataMessageHandler */ | ||
private $messageHandler; | ||
|
||
public function __construct(MetadataMessageHandler $messageHandler) | ||
{ | ||
$this->messageHandler = $messageHandler; | ||
} | ||
|
||
public function handle(DateTimeImmutable $moment): void | ||
{ | ||
$this->messageHandler->maximum($moment); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.