Skip to content

Commit

Permalink
Drop provide method from DataProviderInferface
Browse files Browse the repository at this point in the history
remp/crm#3284
  • Loading branch information
miroc committed Sep 18, 2024
1 parent 99b804b commit ada99b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/Models/DataProvider/DataProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

interface DataProviderInterface
{
public function provide(array $params);
}
8 changes: 4 additions & 4 deletions src/Models/DataProvider/DataProviderManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

class DataProviderManager
{
private $providers = [];
private array $providers = [];

public function registerDataProvider($path, DataProviderInterface $provider, $priority = 100)
public function registerDataProvider($path, DataProviderInterface $provider, $priority = 100): void
{
if (isset($this->providers[$path][$priority])) {
do {
Expand All @@ -18,11 +18,11 @@ public function registerDataProvider($path, DataProviderInterface $provider, $pr

/**
* @param string $path
* @param string $validateInterface name of the interface the providers should implement. DataProviderException will be thrown if not
* @param string|null $validateInterface name of the interface the providers should implement. DataProviderException will be thrown if not
* @return DataProviderInterface[]
* @throws DataProviderException
*/
public function getProviders(string $path, ?string $validateInterface = null)
public function getProviders(string $path, ?string $validateInterface = null): array
{
if (isset($this->providers[$path])) {
$result = $this->providers[$path];
Expand Down
8 changes: 8 additions & 0 deletions src/Models/DataProvider/DefaultDataProviderInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Crm\ApplicationModule\Models\DataProvider;

interface DefaultDataProviderInterface extends DataProviderInterface
{
public function provide(array $params);
}

0 comments on commit ada99b0

Please sign in to comment.