Skip to content

Commit

Permalink
Dynamic call to static method (some of).
Browse files Browse the repository at this point in the history
  • Loading branch information
LastDragon-ru committed Aug 14, 2021
1 parent 2fcee08 commit 06618a4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
16 changes: 7 additions & 9 deletions packages/queue/src/QueueableConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
* Queueable configurator.
*/
class QueueableConfigurator {
protected Container $container;
protected Repository $config;
protected DateFactory $dateFactory;
protected Container $container;
protected Repository $config;

public function __construct(Container $container, Repository $config, DateFactory $dateFactory) {
$this->dateFactory = $dateFactory;
$this->container = $container;
$this->config = $config;
public function __construct(Container $container, Repository $config) {
$this->container = $container;
$this->config = $config;
}

public function config(ConfigurableQueueable $queueable): QueueableConfig {
Expand All @@ -50,9 +48,9 @@ public function configure(ConfigurableQueueable $queueable): void {
$novalue = __METHOD__;
$properties = array_keys($this->getQueueableProperties());
$preparers = [
'retryUntil' => function ($value): ?DateTimeInterface {
'retryUntil' => static function ($value): ?DateTimeInterface {
if (is_string($value)) {
$value = $this->dateFactory->now()->add($value);
$value = DateFactory::now()->add($value);
}

return $value;
Expand Down
8 changes: 4 additions & 4 deletions packages/testing/src/Assertions/XmlAssertionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public function testAssertXmlMatchesSchema(): void {
use XmlAssertions;
};

$assertion->assertXmlMatchesSchema($data->file('.rng'), $data->dom('.xml'));
$assertion->assertXmlMatchesSchema($data->file('.xsd'), $data->dom('.xml'));
$assertion->assertXmlMatchesSchema($data->file('.rng'), $data->file('.xml'));
$assertion->assertXmlMatchesSchema($data->file('.xsd'), $data->file('.xml'));
$assertion::assertXmlMatchesSchema($data->file('.rng'), $data->dom('.xml'));
$assertion::assertXmlMatchesSchema($data->file('.xsd'), $data->dom('.xml'));
$assertion::assertXmlMatchesSchema($data->file('.rng'), $data->file('.xml'));
$assertion::assertXmlMatchesSchema($data->file('.xsd'), $data->file('.xml'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public function isMatchesSchema(SplFileInfo $schema, SplFileInfo|DOMDocument $xm
}

// Create Reader
$reader = new XMLReader();
$reader = XMLReader::open($xml->getPathname());

if (!$reader->open($xml->getPathname())) {
if (!($reader instanceof XMLReader)) {
throw new RuntimeException(sprintf('Failed to load XML from `%s`.', $xml->getPathname()));
}

Expand Down

0 comments on commit 06618a4

Please sign in to comment.