-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update dependencies * Update composer.json * Update composer.json * Update readme * sulu 2.0 compatibility * add new viewbuilder for automation * Add php-cs-fixer * add editorconfig * resolve dispatch deprecation * refactor controllers * phpstan installation and some phpstan fixes * phpstan fixes * styleci fixes * travis and phpunit settings * increase test memory limit * fix php unit tests * upgrade to sulu 2.0.1 branch * fix remaining phpstan errors * use class instead of interface * adjust installation documentation * Set min requirement to sulu/sulu 2.0.1 * Set min requirement to php-task/php-task dev-master * pr changes * remove unnecessary phpdocs * fix translation file * Adjust php-task version
- Loading branch information
1 parent
a090110
commit 395d782
Showing
96 changed files
with
1,180 additions
and
1,788 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
max_line_length = 120 | ||
|
||
# markdown uses two trailing spaces for explicit line breaks | ||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,29 @@ | ||
/Tests/app/cache/* | ||
/Tests/app/logs/* | ||
/Tests/app/data/* | ||
/Tests/Application/cache/* | ||
/Tests/Application/logs/* | ||
/Tests/Application/data/* | ||
/node_modules/ | ||
/vendor/ | ||
/composer.phar | ||
/composer.lock | ||
/.sass-cache/ | ||
|
||
# PHPUnit | ||
/app/phpunit.xml | ||
/phpunit.xml | ||
*~ | ||
.phpunit.result.cache | ||
|
||
# composer | ||
/composer.phar | ||
/composer.lock | ||
/auth.json | ||
/vendor | ||
|
||
# IDEs | ||
.idea/* | ||
*.iml | ||
*~ | ||
|
||
# tests | ||
Tests/Application/var | ||
Tests/Application/.env.test.local | ||
|
||
# php-cs-fixer | ||
.php_cs.cache | ||
php-cs-fixer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
$header = <<<EOF | ||
This file is part of Sulu. | ||
(c) Sulu GmbH | ||
This source file is subject to the MIT license that is bundled | ||
with this source code in the file LICENSE. | ||
EOF; | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->exclude(['var/cache']) | ||
->in(__DIR__); | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRules([ | ||
'@Symfony' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'class_definition' => false, | ||
'concat_space' => ['spacing' => 'one'], | ||
'function_declaration' => ['closure_function_spacing' => 'none'], | ||
'header_comment' => ['header' => $header], | ||
'ordered_imports' => true, | ||
'phpdoc_align' => ['align' => 'left'], | ||
'phpdoc_types_order' => false, | ||
]) | ||
->setFinder($finder); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Sulu. | ||
* | ||
* (c) Sulu GmbH | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace Sulu\Bundle\AutomationBundle\Admin\View; | ||
|
||
use Sulu\Bundle\AdminBundle\Admin\View\FormOverlayListViewBuilder; | ||
use Sulu\Bundle\AdminBundle\Admin\View\ToolbarAction; | ||
use Sulu\Bundle\AutomationBundle\Entity\Task; | ||
|
||
class AutomationViewBuilder extends FormOverlayListViewBuilder implements AutomationViewBuilderInterface | ||
{ | ||
public function __construct(string $name, string $path) | ||
{ | ||
parent::__construct($name, $path); | ||
|
||
$listToolbarActions = [ | ||
new ToolbarAction('sulu_admin.add'), | ||
new ToolbarAction('sulu_admin.delete'), | ||
]; | ||
|
||
$this->setResourceKey(Task::RESOURCE_KEY) | ||
->setListKey(Task::RESOURCE_KEY) | ||
->setFormKey('task_details') | ||
->setTabTitle('sulu_automation.automation') | ||
->addToolbarActions($listToolbarActions) | ||
->addListAdapters(['table']) | ||
->setTabOrder(4096) | ||
->addRouterAttributesToFormRequest(['id' => 'entityId']) | ||
->addRouterAttributesToListRequest(['id' => 'entityId']); | ||
} | ||
|
||
public function setEntityClass(string $entityClass): AutomationViewBuilderInterface | ||
{ | ||
$this->addRequestParameter('entityClass', $entityClass); | ||
$this->addMetadataRequestParameters(['entityClass' => $entityClass]); | ||
|
||
return $this; | ||
} | ||
|
||
private function addRequestParameter(string $key, string $value): void | ||
{ | ||
$oldRequestParameters = $this->getView()->getOption('requestParameters'); | ||
$newRequestParameters = $oldRequestParameters | ||
? array_merge($oldRequestParameters, [$key => $value]) | ||
: [$key => $value]; | ||
|
||
$this->setRequestParameters($newRequestParameters); | ||
} | ||
} |
Oops, something went wrong.