Skip to content

Commit

Permalink
Ensure we only load the 1.8 parsers on 1.8+ sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosp committed Nov 25, 2024
1 parent 63c3e96 commit c74499c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Strategies/SimpleStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use PHRETS\Configuration;
use PHRETS\Exceptions\ParserNotFound;
use PHRETS\Parsers\Login\OneEight;
use PHRETS\Parsers\ParserType;

class SimpleStrategy implements Strategy
Expand All @@ -25,8 +24,6 @@ class SimpleStrategy implements Strategy
ParserType::METADATA_OBJECT->value => \PHRETS\Parsers\GetMetadata\BaseObject::class,
ParserType::METADATA_LOOKUP->value => \PHRETS\Parsers\GetMetadata\Lookup::class,
ParserType::METADATA_LOOKUPTYPE->value => \PHRETS\Parsers\GetMetadata\LookupType::class,
ParserType::UPDATE->value => \PHRETS\Parsers\Update\OneEight::class,
ParserType::OBJECT_POST->value => \PHRETS\Parsers\PostObject\OneEight::class,
ParserType::XML->value => \PHRETS\Parsers\XML::class,
];

Expand Down Expand Up @@ -61,7 +58,9 @@ public function provide(ParserType $parser): mixed
public function initialize(Configuration $configuration): void
{
if ($configuration->getRetsVersion()->isAtLeast1_8()) {
$this->classes[ParserType::LOGIN->value] = OneEight::class;
$this->classes[ParserType::LOGIN->value] = \PHRETS\Parsers\Login\OneEight::class;
$this->classes[ParserType::OBJECT_POST->value] = \PHRETS\Parsers\PostObject\OneEight::class;
$this->classes[ParserType::UPDATE->value] = \PHRETS\Parsers\Update\OneEight::class;
}

foreach ($this->classes as $k => $v) {
Expand Down

0 comments on commit c74499c

Please sign in to comment.