Skip to content

Commit 5173831

Browse files
committed
DependencyInjection refactoring
1 parent 869a20c commit 5173831

File tree

5 files changed

+46
-8
lines changed

5 files changed

+46
-8
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Björn Hempel <bjoern@hempel.li>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

docs/index.md

Whitespace-only changes.

src/DependencyInjection/PhpApiVersionExtension.php renamed to src/DependencyInjection/IxnodePhpApiVersionExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* @version 0.1.0 (2023-01-01)
2727
* @since 0.1.0 (2023-01-01) First version.
2828
*/
29-
class PhpApiVersionExtension extends Extension
29+
class IxnodePhpApiVersionExtension extends Extension
3030
{
3131
/**
3232
* Loads the given configuration files.
@@ -39,7 +39,7 @@ class PhpApiVersionExtension extends Extension
3939
*/
4040
public function load(array $configs, ContainerBuilder $container): void
4141
{
42-
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
42+
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../../config'));
4343
$loader->load('services.yaml');
4444
}
4545
}

src/IxnodePhpApiVersionBundle.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,26 @@
1414

1515
namespace Ixnode\PhpApiVersionBundle;
1616

17-
use Symfony\Component\HttpKernel\Bundle\Bundle;
17+
use Ixnode\PhpApiVersionBundle\DependencyInjection\IxnodePhpApiVersionExtension;
18+
use Symfony\Component\DependencyInjection\Extension\Extension;
19+
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;
1820

1921
/**
20-
* Class PhpApiVersionBundle
22+
* Class IxnodePhpApiVersionBundle
2123
*
2224
* @author Björn Hempel <bjoern@hempel.li>
2325
* @version 0.1.0 (2023-01-01)
2426
* @since 0.1.0 (2023-01-01) First version.
2527
*/
26-
class IxnodePhpApiVersionBundle extends Bundle
28+
class IxnodePhpApiVersionBundle extends AbstractBundle
2729
{
28-
30+
/**
31+
* Returns the Extension class.
32+
*
33+
* @return Extension|null
34+
*/
35+
public function getContainerExtension(): ?Extension
36+
{
37+
return new IxnodePhpApiVersionExtension();
38+
}
2939
}

src/Resources/config/services.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
# This file is the entry point to configure your own services.
2+
# Files in the packages/ subdirectory configure your dependencies.
3+
4+
# Put parameters here that don't need to change on each machine where the app is deployed
5+
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
6+
parameters:
7+
18
services:
2-
ixnode_php_api_version_bundle_command_version_command:
3-
class: Ixnode\PhpApiVersionBundle\Command\VersionCommand
9+
ixnode_php_api_version_bundle_command_version_version_command:
10+
class: Ixnode\PhpApiVersionBundle\Command\Version\VersionCommand
411
tags:
512
- { name: console.command }

0 commit comments

Comments
 (0)