Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
preset: symfony
52 changes: 33 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,48 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm

sudo: false

cache:
directories:
- $HOME/.composer/cache

env:
- SYMFONY_VERSION=2.5.*
- SYMFONY_VERSION=2.7.* SYMFONY_DEPRECATIONS_HELPER=weak

matrix:
allow_failures:
- env: SYMFONY_VERSION=dev-master
include:
- php: 5.5
env: SYMFONY_VERSION=2.3.*
- php: 5.5
env: SYMFONY_VERSION=2.4.*
- php: 5.5
env: SYMFONY_VERSION=dev-master


- php: 5.3
env: SYMFONY_VERSION=2.3.* COMPOSER_FLAGS="--prefer-lowest"
- php: 5.6
env: SYMFONY_VERSION=2.3.* SYMFONY_DEPRECATIONS_HELPER=weak
- php: 5.6
env: SYMFONY_VERSION=2.8.*
- php: 5.6
env: SYMFONY_VERSION=3.0.*
allow_failures:
- env: SYMFONY_VERSION=2.8.*
- env: SYMFONY_VERSION=3.0.*
fast_finish: true

before_script:
before_install:
- sh -c 'if [ "${TRAVIS_PHP_VERSION}" != "hhvm" ]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;'
- composer self-update
- echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer require symfony/symfony:${SYMFONY_VERSION} --prefer-source
- composer require symfony/symfony:${SYMFONY_VERSION} --no-update
- composer update $COMPOSER_FLAGS --prefer-dist
- vendor/symfony-cmf/testing/bin/travis/phpcr_odm_doctrine_dbal.sh

before_script: vendor/symfony-cmf/testing/bin/travis/phpcr_odm_doctrine_dbal.sh

script: phpunit --coverage-text

notifications:
irc: "irc.freenode.org#symfony-cmf"
email: "[email protected]"
email: "[email protected]"
13 changes: 5 additions & 8 deletions Admin/BlogAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,22 @@
/*
* This file is part of the Symfony CMF package.
*
* (c) 2011-2014 Symfony CMF
* (c) 2011-2015 Symfony CMF
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\BlogBundle\Admin;

use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\DoctrinePHPCRAdminBundle\Admin\Admin;
use Symfony\Cmf\Bundle\BlogBundle\Form\PostType;
use Symfony\Cmf\Bundle\BlogBundle\Routing\BlogRouteManager;

/**
* Blog Admin
* Blog Admin.
*
* @author Daniel Leech <[email protected]>
*/
Expand All @@ -34,9 +31,9 @@ protected function configureFormFields(FormMapper $mapper)
{
$mapper->add('name', 'text');
$mapper->add('parent', 'doctrine_phpcr_odm_tree', array(
'root_node' => $this->blogRoot,
'choice_list' => array(),
'select_root_node' => true)
'root_node' => $this->blogRoot,
'choice_list' => array(),
'select_root_node' => true, )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is weird. the parenthesis should be on the next line

);
}

Expand Down
6 changes: 2 additions & 4 deletions Admin/PostAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@
/*
* This file is part of the Symfony CMF package.
*
* (c) 2011-2014 Symfony CMF
* (c) 2011-2015 Symfony CMF
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\BlogBundle\Admin;

use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\DoctrinePHPCRAdminBundle\Admin\Admin;
use Symfony\Cmf\Bundle\BlogBundle\Form\PostType;
use Symfony\Cmf\Bundle\BlogBundle\Form\DataTransformer\CsvToArrayTransformer;

/**
* Post Admin
* Post Admin.
*
* @author Daniel Leech <[email protected]>
*/
Expand Down
13 changes: 6 additions & 7 deletions Block/TagCloudBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,28 @@
/*
* This file is part of the Symfony CMF package.
*
* (c) 2011-2014 Symfony CMF
* (c) 2011-2015 Symfony CMF
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\BlogBundle\Block;

use Symfony\Component\HttpFoundation\Response;
use Sonata\BlockBundle\Model\BlockInterface;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\BlockBundle\Block\BaseBlockService;
use Doctrine\ODM\PHPCR\DocumentManager;
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
use Symfony\Cmf\Bundle\BlogBundle\Repository\TagRepository;

/**
* Tag Cloud block service
* Tag Cloud block service.
*
* @author Daniel Leech <[email protected]>
*/
class TagCloudBlockService extends BaseBlockService
class TagCloudBlock extends BaseBlockService
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erm, we should check if we need to fix the file name or the class name. not sure how this ever could work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this entire class is pretty broken as TagRepository also doesn't exist .. it also appears like the class isn't even configured as a service either.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so lets delete the class? or leave this alone and try to wrap up #59? or just deprecate and stop this bundle completely to focus on things we actually maintain?

{
protected $repo;

Expand All @@ -39,7 +37,7 @@ public function __construct($name, EngineInterface $templating, TagRepository $r
public function getDefaultSettings()
{
return array(
'path' => 'cmf_blog_post_index'
'path' => 'cmf_blog_post_index',
);
}

Expand All @@ -54,9 +52,10 @@ public function validateBlock(ErrorElement $errorElement, BlockInterface $block)
public function execute(BlockInterface $block, Response $response = null)
{
$wTags = $this->repo->getWeightedTags();

return $this->renderResponse('CmfBlogBundle:Block:tagCloud.html.twig', array(
'block' => $block,
'wTags' => $wTags
'wTags' => $wTags,
));
}
}
3 changes: 1 addition & 2 deletions CmfBlogBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
/*
* This file is part of the Symfony CMF package.
*
* (c) 2011-2014 Symfony CMF
* (c) 2011-2015 Symfony CMF
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\BlogBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand Down
14 changes: 6 additions & 8 deletions Controller/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
/*
* This file is part of the Symfony CMF package.
*
* (c) 2011-2014 Symfony CMF
* (c) 2011-2015 Symfony CMF
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\BlogBundle\Controller;

use Doctrine\ODM\PHPCR\DocumentManager;
Expand All @@ -23,7 +22,7 @@
use FOS\RestBundle\View\View;

/**
* Blog Controller
* Blog Controller.
*
* @author Daniel Leech <[email protected]>
*/
Expand Down Expand Up @@ -56,7 +55,6 @@ class BlogController
*/
private $publishWorkflowPermission = PublishWorkflowChecker::VIEW_ATTRIBUTE;


public function __construct(
EngineInterface $templating,
ViewHandlerInterface $viewHandler = null,
Expand Down Expand Up @@ -85,6 +83,7 @@ protected function renderResponse($contentTemplate, $params)
if ($this->viewHandler) {
$view = new View($params);
$view->setTemplate($contentTemplate);

return $this->viewHandler->handle($view);
}

Expand All @@ -102,11 +101,10 @@ public function viewPostAction(Post $contentDocument, $contentTemplate = null)

if (true !== $this->securityContext->isGranted($this->publishWorkflowPermission, $post)) {
throw new NotFoundHttpException(sprintf(
'Post "%s" is not published'
, $post->getTitle()));
'Post "%s" is not published', $post->getTitle()));
}

$contentTemplate = $contentTemplate ? : 'CmfBlogBundle:Blog:view_post.html.twig';
$contentTemplate = $contentTemplate ?: 'CmfBlogBundle:Blog:view_post.html.twig';

return $this->renderResponse($contentTemplate, array(
'post' => $post,
Expand Down Expand Up @@ -138,7 +136,7 @@ public function listAction(Request $request, $contentDocument, $contentTemplate
return $this->renderResponse($contentTemplate, array(
'blog' => $blog,
'posts' => $posts,
'tag' => $tag
'tag' => $tag,
));
}
}
10 changes: 4 additions & 6 deletions DependencyInjection/CmfBlogExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,29 @@
/*
* This file is part of the Symfony CMF package.
*
* (c) 2011-2014 Symfony CMF
* (c) 2011-2015 Symfony CMF
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\BlogBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;

use Symfony\Cmf\Bundle\RoutingBundle\Routing\DynamicRouter;

/**
* This is the class that loads and manages your bundle configuration
* This is the class that loads and manages your bundle configuration.
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class CmfBlogExtension extends Extension
{
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
Expand Down Expand Up @@ -67,7 +65,7 @@ private function loadSonataAdmin($config, XmlFileLoader $loader, ContainerBuilde
}

$loader->load('blog-admin.xml');
$container->setParameter($this->getAlias() . '.blog_basepath', $config['blog_basepath']);
$container->setParameter($this->getAlias().'.blog_basepath', $config['blog_basepath']);
}

private function loadMenuIntegration($config, XmlFileLoader $loader, ContainerBuilder $container)
Expand Down
17 changes: 8 additions & 9 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,25 @@
/*
* This file is part of the Symfony CMF package.
*
* (c) 2011-2014 Symfony CMF
* (c) 2011-2015 Symfony CMF
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/


namespace Symfony\Cmf\Bundle\BlogBundle\DependencyInjection;

use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;

/**
* This class contains the configuration information for the bundle
*
* This information is solely responsible for how the different configuration
* sections are normalized, and merged.
*
* @author David Buchmann
*/
* This class contains the configuration information for the bundle.
*
* This information is solely responsible for how the different configuration
* sections are normalized, and merged.
*
* @author David Buchmann
*/
class Configuration implements ConfigurationInterface
{
/**
Expand Down
Loading