Skip to content

Commit

Permalink
moved ContainerAwareInterface, ContainerAwareTrait in pp (#13)
Browse files Browse the repository at this point in the history
Co-authored-by: Yury Bushenko <yury.bushenko@dalee.ru>
  • Loading branch information
Nastro and Yury Bushenko authored Jun 18, 2024
1 parent bee3f83 commit 5725bdb
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 18 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change log

## [3.0.8] 2024-06-18
- Перенесены устаревшие ContainerAwareTrait и ContainerAwareInterface из Symfony\DependencyInjection

## [3.0.7] 2024-03-27
- Исправлены предупреждения в модуле ACL в сортировке правил

Expand Down
2 changes: 1 addition & 1 deletion cronruns/queue.cronrun.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use PP\Lib\PersistentQueue;
use PP\Cron\AbstractCron;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use PP\DependencyInjection\ContainerAwareInterface;

/**
* Class PXCronRunQueue
Expand Down
2 changes: 1 addition & 1 deletion lib/Engine/action.class.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use PP\Lib\Http\Response;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use PP\DependencyInjection\ContainerAwareInterface;
use PP\Lib\Engine\AbstractEngine;

class PXEngineAction extends AbstractEngine
Expand Down
2 changes: 1 addition & 1 deletion lib/Engine/index.class.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use PP\Lib\Http\Response;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use PP\DependencyInjection\ContainerAwareInterface;
use PP\Lib\Engine\AbstractEngine;

class PXEngineIndex extends AbstractEngine
Expand Down
2 changes: 1 addition & 1 deletion lib/Engine/json.class.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use PP\Lib\Http\Response;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use PP\DependencyInjection\ContainerAwareInterface;
use PP\Lib\Engine\AbstractEngine;
use PP\Module\AbstractModule;

Expand Down
2 changes: 1 addition & 1 deletion lib/common.version.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

define('PP_VERSION', 'v3.0.7');
define('PP_VERSION', 'v3.0.8');
2 changes: 1 addition & 1 deletion src/Command/CronCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace PP\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use PP\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down
2 changes: 1 addition & 1 deletion src/ConsoleApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use PP\DependencyInjection\ContainerAwareTrait;

use PP\Command\GetPropertyCommand;
use PP\Lib\Command\AbstractCommand;
Expand Down
4 changes: 2 additions & 2 deletions src/Cron/AbstractCron.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace PP\Cron;

use PP\Lib\Datastruct\Tree;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use PP\DependencyInjection\ContainerAwareInterface;
use PP\DependencyInjection\ContainerAwareTrait;
use PP\Lib\Database\Driver\PostgreSqlDriver;

/**
Expand Down
19 changes: 19 additions & 0 deletions src/DependencyInjection/ContainerAwareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace PP\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* ContainerAwareInterface should be implemented by classes that depends on a Container.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface ContainerAwareInterface
{
/**
* @param ContainerInterface|null $container
* @return void
*/
public function setContainer(?ContainerInterface $container);
}
31 changes: 31 additions & 0 deletions src/DependencyInjection/ContainerAwareTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace PP\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* ContainerAware trait.
* @author Fabien Potencier <fabien@symfony.com>
*/
trait ContainerAwareTrait
{
/**
* @var ContainerInterface|null
*/
protected $container;


/**
* @param ContainerInterface|null $container
* @return void
*/
public function setContainer(?ContainerInterface $container = null): void
{
if (1 > \func_num_args()) {
trigger_deprecation('symfony/dependency-injection', '6.2', 'Calling "%s::%s()" without any arguments is deprecated, pass null explicitly instead.', __CLASS__, __FUNCTION__);
}

$this->container = $container;
}
}
4 changes: 2 additions & 2 deletions src/Lib/Command/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace PP\Lib\Command;

use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use PP\DependencyInjection\ContainerAwareInterface;
use PP\DependencyInjection\ContainerAwareTrait;
use PP\Lib\Database\Driver\PostgreSqlDriver;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Lib/Engine/Admin/AdminEngineAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace PP\Lib\Engine\Admin;

use PP\Lib\Http\Response;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use PP\DependencyInjection\ContainerAwareInterface;

/**
* Class AdminEngineAction.
Expand Down
2 changes: 1 addition & 1 deletion src/Lib/Engine/Admin/AdminEngineIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace PP\Lib\Engine\Admin;

use PP\Lib\Http\Response;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use PP\DependencyInjection\ContainerAwareInterface;
use PXModuleDescription;
use PP\Lib\Html\Layout\AdminHtmlLayout;

Expand Down
2 changes: 1 addition & 1 deletion src/Lib/Engine/Admin/AdminEngineJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace PP\Lib\Engine\Admin;

use PP\Lib\Http\Response;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use PP\DependencyInjection\ContainerAwareInterface;

/**
* Class AdminEngineJson.
Expand Down
2 changes: 1 addition & 1 deletion src/Lib/Engine/Admin/AdminEnginePopup.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace PP\Lib\Engine\Admin;

use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use PP\DependencyInjection\ContainerAwareInterface;

/**
* Class AdminEnginePopup.
Expand Down
2 changes: 1 addition & 1 deletion src/Module/AbstractModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace PP\Module;

use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use PP\DependencyInjection\ContainerAwareTrait;

/**
* Class AbstractModule.
Expand Down
2 changes: 1 addition & 1 deletion src/Module/CronRunModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace PP\Module;

use PP\Cron\AbstractCron;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use PP\DependencyInjection\ContainerAwareInterface;
use PP\Lib\Datastruct\Tree;
use PP\Cron\CronRule;
use PXRegistry;
Expand Down
2 changes: 1 addition & 1 deletion src/Module/ModuleInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace PP\Module;

use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use PP\DependencyInjection\ContainerAwareInterface;

/**
* Interface ModuleInterface.
Expand Down

0 comments on commit 5725bdb

Please sign in to comment.