Skip to content

Commit

Permalink
Fixed the naming issues
Browse files Browse the repository at this point in the history
  • Loading branch information
qzminski committed May 22, 2017
1 parent 8c017ba commit 256af07
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/02-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Setup your desired page types in the file:

```yaml
# app/config/config.yml
cfg_link_registry:
codefog_link_registry:
types: ["app_login", "app_logout", "app_profile"]
```

Expand Down
2 changes: 1 addition & 1 deletion docs/03-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Here is the example how to use the registry in the project source files:

```php
$linkRegistry = $container->get('cfg_link_registry');
$linkRegistry = $container->get('codefog_link_registry');

if ($linkRegistry->hasEntry('app_login')) {
$entry = $linkRegistry->getEntry('app_login');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@

use Symfony\Component\HttpKernel\Bundle\Bundle;

class LinkRegistryBundle extends Bundle
class CodefogLinkRegistryBundle extends Bundle
{
}
4 changes: 2 additions & 2 deletions src/ContaoManager/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Codefog\LinkRegistryBundle\ContaoManager;

use Codefog\LinkRegistryBundle\LinkRegistryBundle;
use Codefog\LinkRegistryBundle\CodefogLinkRegistryBundle;
use Contao\CoreBundle\ContaoCoreBundle;
use Contao\ManagerPlugin\Bundle\BundlePluginInterface;
use Contao\ManagerPlugin\Bundle\Config\BundleConfig;
Expand All @@ -26,7 +26,7 @@ class Plugin implements BundlePluginInterface
public function getBundles(ParserInterface $parser)
{
return [
BundleConfig::create(LinkRegistryBundle::class)->setLoadAfter([ContaoCoreBundle::class]),
BundleConfig::create(CodefogLinkRegistryBundle::class)->setLoadAfter([ContaoCoreBundle::class]),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension;

class LinkRegistryExtension extends ConfigurableExtension
class CodefogLinkRegistryExtension extends ConfigurableExtension
{
/**
* {@inheritdoc}
Expand All @@ -28,6 +28,6 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
$loader->load('listener.yml');
$loader->load('services.yml');

$container->setParameter('cfg_link_registry.types', $mergedConfig['types']);
$container->setParameter('codefog_link_registry.types', $mergedConfig['types']);
}
}
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Configuration implements ConfigurationInterface
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('cfg_link_registry');
$rootNode = $treeBuilder->root('codefog_link_registry');

$rootNode
->children()
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/config/listener.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
services:
cfg_link_registry.listener.data_container:
codefog_link_registry.listener.data_container:
class: Codefog\LinkRegistryBundle\EventListener\DataContainerListener
arguments:
- '@database_connection'
- '@cfg_link_registry'
- '@codefog_link_registry'

cfg_link_registry.listener.insert_tags:
codefog_link_registry.listener.insert_tags:
class: Codefog\LinkRegistryBundle\EventListener\InsertTagsListener
arguments:
- '@cfg_link_registry'
- '@codefog_link_registry'
4 changes: 2 additions & 2 deletions src/Resources/config/services.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
services:
cfg_link_registry:
codefog_link_registry:
class: Codefog\LinkRegistryBundle\LinkRegistry
arguments:
- '@contao.framework'
- '@database_connection'
- '@security.token_storage'
- '%cfg_link_registry.types%'
- '%codefog_link_registry.types%'
2 changes: 1 addition & 1 deletion src/Resources/contao/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
/*
* Hooks
*/
$GLOBALS['TL_HOOKS']['replaceInsertTags'][] = ['cfg_link_registry.insert_tags', 'onReplace'];
$GLOBALS['TL_HOOKS']['replaceInsertTags'][] = ['codefog_link_registry.insert_tags', 'onReplace'];
2 changes: 1 addition & 1 deletion src/Resources/contao/dca/tl_cfg_link_registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
'label' => &$GLOBALS['TL_LANG']['tl_cfg_link_registry']['entries'],
'exclude' => true,
'inputType' => 'cfg_link_registry',
'options_callback' => ['cfg_link_registry.listener.data_container', 'getLinkTypes'],
'options_callback' => ['codefog_link_registry.listener.data_container', 'getLinkTypes'],
'reference' => &$GLOBALS['TL_LANG']['tl_cfg_link_registry']['types'],
'sql' => ['type' => 'blob'],
],
Expand Down
4 changes: 2 additions & 2 deletions tests/ContaoManager/PluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Codefog\LinkRegistryBundle\Test\ContaoManager;

use Codefog\LinkRegistryBundle\LinkRegistryBundle;
use Codefog\LinkRegistryBundle\CodefogLinkRegistryBundle;
use Codefog\LinkRegistryBundle\ContaoManager\Plugin;
use Contao\CoreBundle\ContaoCoreBundle;
use Contao\ManagerPlugin\Bundle\Config\BundleConfig;
Expand All @@ -34,7 +34,7 @@ public function testGetBundles()

static::assertCount(1, $bundles);
static::assertInstanceOf(BundleConfig::class, $config);
static::assertEquals(LinkRegistryBundle::class, $config->getName());
static::assertEquals(CodefogLinkRegistryBundle::class, $config->getName());
static::assertEquals([ContaoCoreBundle::class], $config->getLoadAfter());
}
}
12 changes: 6 additions & 6 deletions tests/DependencyInjection/LinkRegistryExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Codefog\LinkRegistryBundle\Test\DependencyInjection;

use Codefog\LinkRegistryBundle\DependencyInjection\LinkRegistryExtension;
use Codefog\LinkRegistryBundle\DependencyInjection\CodefogLinkRegistryExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;

Expand All @@ -21,12 +21,12 @@ class LinkRegistryExtensionTest extends TestCase
public function testLoad()
{
$container = new ContainerBuilder();
$extension = new LinkRegistryExtension();
$extension = new CodefogLinkRegistryExtension();
$extension->load([], $container);

$this->assertTrue($container->hasDefinition('cfg_link_registry'));
$this->assertTrue($container->hasDefinition('cfg_link_registry.listener.data_container'));
$this->assertTrue($container->hasDefinition('cfg_link_registry.listener.insert_tags'));
$this->assertTrue($container->hasParameter('cfg_link_registry.types'));
$this->assertTrue($container->hasDefinition('codefog_link_registry'));
$this->assertTrue($container->hasDefinition('codefog_link_registry.listener.data_container'));
$this->assertTrue($container->hasDefinition('codefog_link_registry.listener.insert_tags'));
$this->assertTrue($container->hasParameter('codefog_link_registry.types'));
}
}

0 comments on commit 256af07

Please sign in to comment.