diff --git a/Command/InstallCommand.php b/Command/InstallCommand.php index 56b4e3a..659ee64 100644 --- a/Command/InstallCommand.php +++ b/Command/InstallCommand.php @@ -9,6 +9,16 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Exception\IOException; +/** + * InstallCommand + * + * @package BraincraftedBootstrapBundle + * @subpackage Command + * @author Florian Eckerstorfer + * @copyright 2012-2013 Florian Eckerstorfer + * @license http://opensource.org/licenses/MIT The MIT License + * @link http://bootstrap.braincrafted.com BraincraftedBootst + */ class InstallCommand extends ContainerAwareCommand { /** @@ -57,6 +67,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $fs->copy($file, $dest); } catch (IOException $e) { $output->writeln(sprintf('Could not copy %s', $file->getBaseName())); + return; } } diff --git a/Composer/ScriptHandler.php b/Composer/ScriptHandler.php index 7db3c2f..061050f 100644 --- a/Composer/ScriptHandler.php +++ b/Composer/ScriptHandler.php @@ -33,7 +33,7 @@ class ScriptHandler public static function install(CommandEvent $event) { $options = self::getOptions($event); - $consolePathOptionsKey = array_key_exists('symfony-bin-dir', $options) ? 'symfony-bin-dir' : 'symfony-app-dir'; + $consolePathOptionsKey = array_key_exists('symfony-bin-dir', $options) ? 'symfony-bin-dir' : 'symfony-app-dir'; $consolePath = $options[$consolePathOptionsKey]; if (!is_dir($consolePath)) { diff --git a/DependencyInjection/AsseticConfiguration.php b/DependencyInjection/AsseticConfiguration.php index 46e397d..44745a9 100644 --- a/DependencyInjection/AsseticConfiguration.php +++ b/DependencyInjection/AsseticConfiguration.php @@ -134,6 +134,7 @@ protected function buildCssWithSass(array $config) protected function buildJs(array $config) { $path = !in_array($config['less_filter'], array('sass', 'scssphp')) ? "/js" : "/javascripts/bootstrap"; + return array( 'inputs' => array( $config['assets_dir'].$path.'/transition.js', diff --git a/Form/Extension/InputGroupButtonExtension.php b/Form/Extension/InputGroupButtonExtension.php index 1951c92..ad231bf 100644 --- a/Form/Extension/InputGroupButtonExtension.php +++ b/Form/Extension/InputGroupButtonExtension.php @@ -94,21 +94,23 @@ public function buildForm(FormBuilderInterface $builder, array $options) * Adds a button * * @param FormBuilderInterface $builder - * @param array $config + * @param array $config + * * @return ButtonBuilder */ protected function addButton(FormBuilderInterface $builder, $config) { $options = (isset($config['options']))? $config['options'] : array(); + return $builder->create($config['name'], $config['type'], $options); } /** * Stores a button for later rendering * - * @param ButtonBuilder $buttonBuilder + * @param ButtonBuilder $buttonBuilder * @param FormBuilderInterface $form - * @param string $position + * @param string $position */ protected function storeButton(ButtonBuilder $buttonBuilder, FormBuilderInterface $form, $position) { diff --git a/Form/Type/FormActionsType.php b/Form/Type/FormActionsType.php index 3d7ea72..6e76207 100644 --- a/Form/Type/FormActionsType.php +++ b/Form/Type/FormActionsType.php @@ -34,9 +34,9 @@ public function buildForm(FormBuilderInterface $builder, array $options) /** * {@inheritdoc} * - * @param FormView $view + * @param FormView $view * @param FormInterface $form - * @param array $options + * @param array $options */ public function buildView(FormView $view, FormInterface $form, array $options) { @@ -51,8 +51,9 @@ public function buildView(FormView $view, FormInterface $form, array $options) * Adds a button * * @param FormBuilderInterface $builder - * @param $name - * @param $config + * @param string $name + * @param array $config + * * @throws \InvalidArgumentException * @return ButtonBuilder */ @@ -66,6 +67,7 @@ protected function addButton($builder, $name, $config) * Validates if child is a Button * * @param FormInterface $field + * * @throws \InvalidArgumentException */ protected function validateButton(FormInterface $field) diff --git a/Form/Type/FormStaticControlType.php b/Form/Type/FormStaticControlType.php index 89c8916..2f19a6c 100644 --- a/Form/Type/FormStaticControlType.php +++ b/Form/Type/FormStaticControlType.php @@ -20,24 +20,31 @@ */ class FormStaticControlType extends AbstractType { - + /** + * {@inheritdoc} + */ public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( - #'mapped' => false, + //'mapped' => false, 'required' => false, 'disabled' => true, )); } + /** + * {@inheritdoc} + */ public function getParent() { return 'text'; } + /** + * {@inheritdoc} + */ public function getName() { return 'bs_static'; } - } diff --git a/Session/FlashMessage.php b/Session/FlashMessage.php index 35ecfce..1052094 100644 --- a/Session/FlashMessage.php +++ b/Session/FlashMessage.php @@ -57,7 +57,7 @@ public function error($message) /** * Sets a danger message. * - * @param $message + * @param string $message */ public function danger($message) { diff --git a/Twig/BootstrapFormExtension.php b/Twig/BootstrapFormExtension.php index f1c9cad..bcc79f7 100644 --- a/Twig/BootstrapFormExtension.php +++ b/Twig/BootstrapFormExtension.php @@ -135,7 +135,7 @@ public function setWidgetCol($widgetCol) /** * Returns the number of columns of widgets. * - * @return integer Number of columns. + * @return integer Number of columns.Class */ public function getWidgetCol() { @@ -224,6 +224,12 @@ public function restoreFormSettings() $this->simpleCol = $settings['simpleCol']; } + /** + * @param string $label + * @param string $value + * + * @return string + */ public function formControlStaticFunction($label, $value) { return sprintf( diff --git a/Twig/BootstrapIconExtension.php b/Twig/BootstrapIconExtension.php index 84a7e47..7f12887 100644 --- a/Twig/BootstrapIconExtension.php +++ b/Twig/BootstrapIconExtension.php @@ -26,9 +26,17 @@ class BootstrapIconExtension extends Twig_Extension * @var string */ private $iconPrefix; + + /** + * @var string + */ private $iconTag; - public function __construct($iconPrefix, $iconTag='span') + /** + * @param string $iconPrefix + * @param string $iconTag + */ + public function __construct($iconPrefix, $iconTag = 'span') { $this->iconPrefix = $iconPrefix; $this->iconTag = $iconTag; @@ -65,13 +73,14 @@ public function getFunctions() /** * Parses the given string and replaces all occurrences of .icon-[name] with the corresponding icon. * - * @param string $text The text to parse + * @param string $text The text to parse * * @return string The HTML code with the icons */ public function parseIconsFilter($text) { $that = $this; + return preg_replace_callback( '/\.icon-([a-z0-9+-]+)/', function ($matches) use ($that) { @@ -84,14 +93,14 @@ function ($matches) use ($that) { /** * Returns the HTML code for the given icon. * - * @param string $icon The name of the icon + * @param string $icon The name of the icon * * @return string The HTML code for the icon */ public function iconFunction($icon) { $icon = str_replace('+', ' '.$this->iconPrefix.'-', $icon); - + return sprintf('<%1$s class="%2$s %2$s-%3$s">', $this->iconTag, $this->iconPrefix, $icon); } diff --git a/Util/PathUtil.php b/Util/PathUtil.php index 2099127..e6c98e9 100644 --- a/Util/PathUtil.php +++ b/Util/PathUtil.php @@ -59,6 +59,7 @@ public function getRelativePath($from, $to) } } } + return implode('/', $relPath); } }