Skip to content

Commit 3aa1e1e

Browse files
author
Florian Eckerstorfer
committed
Changed namespace from Bc to Braincrafted
1 parent d1d9076 commit 3aa1e1e

File tree

8 files changed

+61
-43
lines changed

8 files changed

+61
-43
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<?php
22
/**
3-
* This file is part of BcSymfony2CodingStandardBundle.
3+
* This file is part of BraincraftedSymfony2CSBundle.
44
*
55
* (c) 2013 Florian Eckerstorfer <[email protected]>
66
*
77
* This source file is subject to the MIT license that is bundled
88
* with this source code in the file LICENSE.
99
*/
1010

11-
namespace Bc\Bundle\Symfony2CodingStandardBundle;
11+
namespace Braincrafted\Bundle\Symfony2CSBundle;
1212

1313
use Symfony\Component\HttpKernel\Bundle\Bundle;
1414

1515
/**
16-
* BcSymfony2CodingStandardBundle
16+
* BraincraftedSymfony2CSBundle
1717
*
1818
* @package BcSymfony2CodingStandardBundle
1919
* @author Florian Eckerstorfer <[email protected]>
2020
* @copyright 2013 Florian Eckerstorfer
2121
* @license http://opensource.org/licenses/MIT The MIT License
2222
*/
23-
class BcSymfony2CodingStandardBundle extends Bundle
23+
class BraincraftedSymfony2CSBundle extends Bundle
2424
{
2525
}

Command/InstallSymfony2CodingStandardCommand.php renamed to Command/InstallSymfony2CSCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22
/**
3-
* This file is part of BcSymfony2CodingStandardBundle.
3+
* This file is part of BraincraftedSymfony2CSBundle.
44
*
55
* (c) 2013 Florian Eckerstorfer <[email protected]>
66
*
77
* This source file is subject to the MIT license that is bundled
88
* with this source code in the file LICENSE.
99
*/
1010

11-
namespace Bc\Bundle\Symfony2CodingStandardBundle\Command;
11+
namespace Braincrafted\Bundle\Symfony2CSBundle\Command;
1212

1313
use Symfony\Component\Console\Command\Command;
1414
use Symfony\Component\Console\Input\InputArgument;
@@ -20,15 +20,15 @@
2020
/**
2121
* InstallSymfony2CodingStandardCommand
2222
*
23-
* @package BcSymfony2CodingStandardBundle
23+
* @package BraincraftedSymfony2CSBundle
2424
* @subpackage Command
2525
* @author Florian Eckerstorfer <[email protected]>
2626
* @copyright 2013 Florian Eckerstorfer
2727
* @license http://opensource.org/licenses/MIT The MIT License
2828
*
2929
* @codeCoverageIgnore
3030
*/
31-
class InstallSymfony2CodingStandardCommand extends Command
31+
class InstallSymfony2CSCommand extends Command
3232
{
3333
/** @var string */
3434
private $rootDir;
@@ -49,7 +49,7 @@ public function __construct($rootDir)
4949
*/
5050
protected function configure()
5151
{
52-
$this->setName('bc:symfony2cs:install');
52+
$this->setName('braincrafted:symfony2cs:install');
5353
}
5454

5555
/**

Composer/ScriptHandler.php

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22
/**
3-
* This file is part of BcSymfony2CodingStandardBundle.
3+
* This file is part of BraincraftedSymfony2CSBundle.
44
*
55
* (c) 2013 Florian Eckerstorfer <[email protected]>
66
*
77
* This source file is subject to the MIT license that is bundled
88
* with this source code in the file LICENSE.
99
*/
1010

11-
namespace Bc\Bundle\Symfony2CodingStandardBundle\Composer;
11+
namespace Braincrafted\Bundle\Symfony2CSBundle\Composer;
1212

1313
use Symfony\Component\ClassLoader\ClassCollectionLoader;
1414
use Symfony\Component\Process\Process;
@@ -18,7 +18,7 @@
1818
/**
1919
* ScriptHandler
2020
*
21-
* @package BcSymfony2CodingStandardBundle
21+
* @package BraincraftedSymfony2CSBundle
2222
* @subpackage Composer
2323
* @author Florian Eckerstorfer <[email protected]>
2424
* @copyright 2013 Florian Eckerstorfer
@@ -29,9 +29,9 @@
2929
class ScriptHandler
3030
{
3131
/**
32-
* @param CommandEvent $event [description]
32+
* @param CommandEvent $event
3333
*/
34-
public static function installSymfony2CodingStandards(CommandEvent $event)
34+
public static function installSymfony2CS(CommandEvent $event)
3535
{
3636
$options = self::getOptions($event);
3737
$appDir = $options['symfony-app-dir'];
@@ -48,9 +48,19 @@ public static function installSymfony2CodingStandards(CommandEvent $event)
4848
return;
4949
}
5050

51-
static::executeCommand($event, $appDir, 'bc:symfony2cs:install', $options['process-timeout']);
51+
static::executeCommand($event, $appDir, 'braincrafted:symfony2cs:install', $options['process-timeout']);
5252
}
5353

54+
/**
55+
* @param CommandEvent $event
56+
* @param string $appDir
57+
* @param string $cmd
58+
* @param integer $timeout
59+
*
60+
* @return void
61+
*
62+
* @throws \RunTimeException when an error occurred when executing the command
63+
*/
5464
protected static function executeCommand(CommandEvent $event, $appDir, $cmd, $timeout = 300)
5565
{
5666
$php = escapeshellarg(self::getPhp());
@@ -70,6 +80,11 @@ protected static function executeCommand(CommandEvent $event, $appDir, $cmd, $ti
7080
}
7181
}
7282

83+
/**
84+
* @param CommandEvent $event
85+
*
86+
* @return array
87+
*/
7388
protected static function getOptions(CommandEvent $event)
7489
{
7590
$options = array_merge(array(
@@ -85,6 +100,9 @@ protected static function getOptions(CommandEvent $event)
85100
return $options;
86101
}
87102

103+
/**
104+
* @return string Path to php executable
105+
*/
88106
protected static function getPhp()
89107
{
90108
$phpFinder = new PhpExecutableFinder;

DependencyInjection/BcSymfony2CodingStandardExtension.php renamed to DependencyInjection/BraincraftedSymfony2CSExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22
/**
3-
* This file is part of BcSymfony2CodingStandardBundle.
3+
* This file is part of BraincraftedSymfony2CSBundle.
44
*
55
* (c) 2013 Florian Eckerstorfer <[email protected]>
66
*
77
* This source file is subject to the MIT license that is bundled
88
* with this source code in the file LICENSE.
99
*/
1010

11-
namespace Bc\Bundle\Symfony2CodingStandardBundle\DependencyInjection;
11+
namespace Braincrafted\Bundle\Symfony2CSBundle\DependencyInjection;
1212

1313
use Symfony\Component\DependencyInjection\ContainerBuilder;
1414
use Symfony\Component\Config\FileLocator;
@@ -18,13 +18,13 @@
1818
/**
1919
* BcSymfony2CodingStandardExtension
2020
*
21-
* @package BcSymfony2CodingStandardBundle
21+
* @package BraincraftedSymfony2CSBundle
2222
* @subpackage DependencyInjection
2323
* @author Florian Eckerstorfer <[email protected]>
2424
* @copyright 2013 Florian Eckerstorfer
2525
* @license http://opensource.org/licenses/MIT The MIT License
2626
*/
27-
class BcSymfony2CodingStandardExtension extends Extension
27+
class BraincraftedSymfony2CSExtension extends Extension
2828
{
2929
/**
3030
* {@inheritDoc}

DependencyInjection/Configuration.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<?php
22
/**
3-
* This file is part of BcSymfony2CodingStandardBundle.
3+
* This file is part of BraincraftedSymfony2CSBundle.
44
*
55
* (c) 2013 Florian Eckerstorfer <[email protected]>
66
*
77
* This source file is subject to the MIT license that is bundled
88
* with this source code in the file LICENSE.
99
*/
1010

11-
namespace Bc\Bundle\Symfony2CodingStandardBundle\DependencyInjection;
11+
namespace Braincrafted\Bundle\Symfony2CSBundle\DependencyInjection;
1212

1313
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
1414
use Symfony\Component\Config\Definition\ConfigurationInterface;
1515

1616
/**
1717
* Configuration
1818
*
19-
* @package BcSymfony2CodingStandardBundle
19+
* @package BraincraftedSymfony2CSBundle
2020
* @subpackage DependencyInjection
2121
* @author Florian Eckerstorfer <[email protected]>
2222
* @copyright 2013 Florian Eckerstorfer
@@ -30,7 +30,7 @@ class Configuration implements ConfigurationInterface
3030
public function getConfigTreeBuilder()
3131
{
3232
$treeBuilder = new TreeBuilder();
33-
$rootNode = $treeBuilder->root('bc_symfony2_coding_standard');
33+
$rootNode = $treeBuilder->root('braincrafed_symfony2_cs');
3434

3535
return $treeBuilder;
3636
}

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
BcSymfony2CodingStandardBundle
2-
==============================
1+
BraincraftedSymfony2CSBundle
2+
============================
33

4-
Sadly [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) does not contain the [Symfony2 coding standard](https://github.com/opensky/Symfony2-coding-standard) and is also not extensible. When you want to install PHP_CodeSniffer using Composer you have to install the coding standard manually whenever PHP_CodeSniffer is updated. Until now.
4+
Unfortunately [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) does not contain the [Symfony2 coding standard](https://github.com/opensky/Symfony2-coding-standard) and is not extensible. If you want to install PHP_CodeSniffer using Composer you have to install the coding standard manually everytime PHP_CodeSniffer is updated. Until now.
55

66

77
Author
@@ -15,7 +15,7 @@ Compatiblity
1515

1616
<table>
1717
<tr>
18-
<th>BcSymfony2CodingStandardBundle</th><th>Symfony</th>
18+
<th>BraincraftedSymfony2CSBundle</th><th>Symfony</th>
1919
</tr>
2020
<tr>
2121
<td><code>0.1.*</code></td><td><code>2.3.*</code></td>
@@ -29,15 +29,15 @@ Compatiblity
2929
Installation
3030
------------
3131

32-
First of all you have to add the bundle to your `composer.json`:
32+
First you have to add the bundle to your `composer.json`:
3333

3434
{
3535
"require": {
3636
"braincrafted/symfony2cs-bundle": "dev-master"
3737
}
3838
}
3939

40-
And then you have to add the bundle to your `AppKernel.php`.
40+
Next you have to add the bundle to your `AppKernel.php`:
4141

4242
// AppKernel.php
4343

@@ -47,7 +47,7 @@ And then you have to add the bundle to your `AppKernel.php`.
4747
{
4848
$bundles = array(
4949
// ...
50-
new Bc\Bundle\Symfony2CodingStandardBundle\BcSymfony2CodingStandardBundle(),
50+
new Braincrafted\Bundle\Symfony2CSBundle\BraincraftedSymfony2CSBundle(),
5151
);
5252

5353
// ...
@@ -56,11 +56,11 @@ And then you have to add the bundle to your `AppKernel.php`.
5656
}
5757
}
5858

59-
Now you can execute the `bc:symfony2cs:install` command to install coding standard:
59+
You can now execute the `braincrafted:symfony2cs:install` command to install the Symfony2 coding standard:
6060

61-
php app/console bc:symfony2cs:install
61+
php app/console braincrafted:symfony2cs:install
6262

63-
However, things get even better if you add the script handler that is included in the bundle to the `post-install-cmd` and `post-update-cmd` sections in your `composer.json`:
63+
However, things get better if you add the script handler that is included in the bundle to the `post-install-cmd` and `post-update-cmd` sections of your `composer.json`:
6464

6565
...
6666
"scripts": {
@@ -70,15 +70,15 @@ However, things get even better if you add the script handler that is included i
7070
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
7171
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
7272
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
73-
"Bc\\Bundle\\Symfony2CodingStandardBundle\\Composer\\ScriptHandler::installSymfony2CodingStandards"
73+
"Braincrafted\\Bundle\\Symfony2CSBundle\\Composer\\ScriptHandler::installSymfony2CS"
7474
],
7575
"post-update-cmd": [
7676
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
7777
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
7878
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
7979
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
8080
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
81-
"Bc\\Bundle\\Symfony2CodingStandardBundle\\Composer\\ScriptHandler::installSymfony2CodingStandards"
81+
"Braincrafted\\Bundle\\Symfony2CSBundle\\Composer\\ScriptHandler::installSymfony2CS"
8282
]
8383
},
8484
...
@@ -87,19 +87,19 @@ However, things get even better if you add the script handler that is included i
8787
Usage
8888
-----
8989

90-
When you add the script handler to the `post-install-cmd` and `post-update-cmd` sections of your `composer.json` the bundle will install or update the coding standard whenever you run `composer install` and `composer update`.
90+
If you add the script handler to the `post-install-cmd` and `post-update-cmd` sections of your `composer.json` the bundle will install or update the coding standard everytime you run `composer install` or `composer update`.
9191

92-
You can now use the Symfony2 coding standard when you run PHP_CodeSniffer:
92+
You can use the Symfony2 coding standard when you run PHP_CodeSniffer:
9393

9494
./bin/phpcs --standard=Symfony2 ./src/
9595

9696

9797
Error handling
9898
--------------
9999

100-
If you should encounter problem, add the `--verbose` option to the command to view the output of the executed commands.
100+
If you should encounter problem add the `--verbose` option to the command to view the output of the executed commands.
101101

102-
php app/console bc:symfony2cs:install --verbose
102+
php app/console braincrafted:symfony2cs:install --verbose
103103

104104

105105
License

Resources/config/services.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
66

77
<parameters>
8-
<parameter key="bc_symfony2_coding_standard.command.install.class">Bc\Bundle\Symfony2CodingStandardBundle\Command\InstallSymfony2CodingStandardCommand</parameter>
8+
<parameter key="braincrafted_symfony2_cs.command.install.class">Braincrafted\Bundle\Symfony2CSBundle\Command\InstallSymfony2CSCommand</parameter>
99
</parameters>
1010

1111
<services>
12-
<service id="bc_symfony2_coding_standard.command.install" class="%bc_symfony2_coding_standard.command.install.class%">
12+
<service id="braincrafted_symfony2_cs.command.install" class="%braincrafted_symfony2_cs.command.install.class%">
1313
<argument>%kernel.root_dir%</argument>
1414
<tag name="console.command" />
1515
</service>

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"minimum-stability": "beta",
1212
"autoload": {
13-
"psr-0": { "Bc\\Bundle\\Symfony2CodingStandardBundle": "" }
13+
"psr-0": { "Braincrafted\\Bundle\\Symfony2CSBundle": "" }
1414
},
15-
"target-dir": "Bc/Bundle/Symfony2CodingStandardBundle"
15+
"target-dir": "Braincrafted/Bundle/Symfony2CSBundle"
1616
}

0 commit comments

Comments
 (0)