Skip to content

SF4 #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

SF4 #88

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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/vendor/
composer.lock
/nbproject/private/
nbproject/project.properties
nbproject/project.xml
2 changes: 1 addition & 1 deletion Console/ApplicationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private function registerCommandsToApplication(Application $application, KernelI
}

/**
* @return Bundle[]
* @return BundleInterface[]
*/
private function getBundlesFromKernel(KernelInterface $kernel)
{
Expand Down
12 changes: 7 additions & 5 deletions Controller/ConsoleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@

use CoreSphere\ConsoleBundle\Contract\Executer\CommandExecuterInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
use Symfony\Bundle\TwigBundle\TwigEngine;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Templating\EngineInterface;
use Twig_Environment;

Choose a reason for hiding this comment

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

Twig_Environment \Twig_Environment


class ConsoleController
{
/**
* @var EngineInterface
* @var Twig_Environment
*/
private $templating;

Expand All @@ -40,7 +42,7 @@ class ConsoleController
private $environment;

public function __construct(
EngineInterface $templating,
Twig_Environment $templating,
CommandExecuterInterface $commandExecuter,
Application $application,
$environment
Expand All @@ -54,7 +56,7 @@ public function __construct(
public function consoleAction()
{
return new Response(
$this->templating->render('CoreSphereConsoleBundle:Console:console.html.twig', [
$this->templating->render('@CoreSphereConsole/Console/console.html.twig', [
'working_dir' => getcwd(),
'environment' => $this->environment,
'commands' => $this->application->all(),
Expand All @@ -78,7 +80,7 @@ public function execAction(Request $request)

return new Response(
$this->templating->render(
'CoreSphereConsoleBundle:Console:result.json.twig',
'@CoreSphereConsole/Console/result.json.twig',
['commands' => $executedCommandsOutput]
)
);
Expand Down
4 changes: 4 additions & 0 deletions DataCollector/DataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ public function getName()
{
return 'coresphere_console';
}

public function reset(){

Choose a reason for hiding this comment

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

CS, be careful to PSR

public function reset()
{
}


}
}
2 changes: 1 addition & 1 deletion Executer/CommandExecuter.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private function getApplication(InputInterface $input)
}

/**
* @return KernelInterface
* @return

Choose a reason for hiding this comment

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

Why remove the TypeHint ?

*/
private function getKernel(InputInterface $input)
{
Expand Down
13 changes: 8 additions & 5 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
services:

coresphere_console.controller:
class: CoreSphere\ConsoleBundle\Controller\ConsoleController
public: true
tags: ['controller.service_arguments']
arguments:
- "@templating"
- "@coresphere_console.executer"
- "@coresphere_console.application"
- "%kernel.environment%"
$templating: "@twig"
$commandExecuter: "@coresphere_console.executer"
$application: "@coresphere_console.application"
$environment: "%kernel.environment%"

coresphere_console.executer:
class: CoreSphere\ConsoleBundle\Executer\CommandExecuter
Expand All @@ -22,7 +25,7 @@ services:
coresphere_console.toolbar:
class: CoreSphere\ConsoleBundle\DataCollector\DataCollector
tags:
- { name: data_collector, template: "CoreSphereConsoleBundle:Toolbar:toolbar", id: "coresphere_console" }
- { name: data_collector, template: "@CoreSphereConsole/Toolbar/toolbar.html.twig", id: "coresphere_console" }

# console application
coresphere_console.application.factory:
Expand Down
6 changes: 3 additions & 3 deletions Resources/views/Console/console.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'CoreSphereConsoleBundle::base.html.twig' %}
{% extends '@CoreSphereConsole/base.html.twig' %}

{% block title %}{{ 'coresphere_console.headline.index'|trans }}{% endblock %}

Expand All @@ -8,8 +8,8 @@
{% endblock %}

{% block body %}
{% include 'CoreSphereConsoleBundle:Console:terminal.html.twig' %}
{% include 'CoreSphereConsoleBundle:Console:htmlTemplates.html.twig' %}
{% include '@CoreSphereConsole/Console/terminal.html.twig' %}
{% include '@CoreSphereConsole/Console/htmlTemplates.html.twig' %}
{% endblock %}

{% block javascripts %}
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/Toolbar/toolbar.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %}
{% extends '@WebProfiler/Profiler/layout.html.twig' %}

{% block toolbar %}
{% set icon %}
Expand All @@ -11,5 +11,5 @@ UNOFjKO13ggwECDAAAMNHZ7ErsJjAAAAAElFTkSuQmCC"/>
{% endset %}
{% set text %}Console{% endset %}

{% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': false } %}
{% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false } %}
{% endblock %}
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
],
"require": {
"php": "^5.5|^7.0",
"symfony/console": "~2.7|~3.0|~4.0",
"symfony/dependency-injection": "~2.7|~3.0|~4.0",
"symfony/event-dispatcher": "~2.7|~3.0|~4.0",
"symfony/framework-bundle": "~2.7|~3.0|~4.0",
"symfony/http-kernel": "~2.7|~3.0|~4.0"
"symfony/console": "~2.7|~4.0",

Choose a reason for hiding this comment

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

Are you that this modification works with SF <= 3.4 ?

"symfony/dependency-injection": "~2.7|~4.0",
"symfony/event-dispatcher": "~2.7|~4.0",
"symfony/framework-bundle": "~2.7|~4.0",
"symfony/http-kernel": "~2.7|~4.0"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^2.2",
Expand Down